From 5f5e784ccd1ebe495df35ae889fb56a10f40b169 Mon Sep 17 00:00:00 2001 From: KHA Entertaiment Date: Mon, 25 May 2026 00:27:43 -0700 Subject: [PATCH] ci: inline npm publish into auto-release workflow Releases created by a workflow's default GITHUB_TOKEN do not trigger other workflows (a GH Actions safety feature against infinite loops). That meant auto-release.yml was creating the release but publish.yml never picked it up. Fix: run typecheck/test/build/publish steps in the same job as the release creation. publish.yml is kept so manual releases created via the GitHub UI (which use the user token and DO cascade) still work. --- .github/workflows/auto-release.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 6e7f241..1bbd3b9 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -6,18 +6,32 @@ on: branches: [main] jobs: - release: + release-and-publish: if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'Release') runs-on: ubuntu-latest permissions: contents: write + id-token: write steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org + - name: Read version from package.json id: pkg run: echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" + - run: npm ci + + - run: npm run typecheck + + - run: npm test + + - run: npm run build + - name: Create GitHub Release env: GH_TOKEN: ${{ github.token }} @@ -26,3 +40,7 @@ jobs: --title "v${{ steps.pkg.outputs.version }}" \ --generate-notes \ --target main + + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}