Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:

permissions:
contents: read
contents: write # needed to create GitHub Releases on tag push

jobs:
publish:
Expand Down Expand Up @@ -57,4 +57,19 @@ jobs:
if: steps.check.outputs.skip != 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
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
Loading