From 2345c331716f91f1a30036f18bdf91d8dc6c4871 Mon Sep 17 00:00:00 2001 From: RECTOR Date: Thu, 23 Jul 2026 15:14:32 +0700 Subject: [PATCH] ci: create GitHub Release on tag push (parity with armory-todo) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror armory-todo's release.yml: bump permissions contents: read → contents: write and add an idempotent 'Create GitHub Release' step that runs after publish (if: success(), so it still fires when npm publish was skipped as already-published). Uses the auto-provided github.token with gh CLI — no third-party action. Keeps GitHub Releases in sync with npm on every v* tag. --- .github/workflows/release.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 601bfde..4def708 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: permissions: - contents: read + contents: write # needed to create GitHub Releases on tag push jobs: publish: @@ -57,4 +57,19 @@ jobs: if: steps.check.outputs.skip != 'true' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access public \ No newline at end of file + run: npm publish --access public + + # Keep GitHub Releases in sync with npm: create a release for the tag + # (auto-generated notes). Idempotent — skips if the release already exists. + # Uses the auto-provided github.token (no third-party action). + - name: Create GitHub Release + if: success() + env: + GH_TOKEN: ${{ github.token }} + run: | + tag="${GITHUB_REF_NAME}" + if gh release view "$tag" >/dev/null 2>&1; then + echo "::notice::Release $tag already exists — skipping" + else + gh release create "$tag" --generate-notes --title "$tag" + fi \ No newline at end of file