ci: add tag-triggered release workflow

On tag push (e.g. 1.0.7), builds from source, runs typecheck + tests,
then creates a GitHub Release with main.js, main.js.map, manifest.json,
and styles.css attached. This replaces the need to commit main.js to
the repository.

Change-Id: I8ccbdddaa45267d2738cc43a4e7fccd1d35346ab
This commit is contained in:
wujunchen 2026-04-27 19:50:17 +08:00
parent f6ce405249
commit e5f5af43ca

42
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Build
run: npm run build
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm run test:only
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
--title "$tag" \
--generate-notes \
main.js main.js.map manifest.json styles.css