From e5f5af43cafb3bad90251d35415019d84302b2b8 Mon Sep 17 00:00:00 2001 From: wujunchen Date: Mon, 27 Apr 2026 19:50:17 +0800 Subject: [PATCH] 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 --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..09f20bb --- /dev/null +++ b/.github/workflows/release.yml @@ -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