Add GitHub release step to CI workflow#173
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a post-publish GitHub Release job to the CI workflow so that pushes to main can automatically create a GitHub Release (with generated notes) after publishing to npm.
Changes:
- Introduce a new
github-releasejob that runs afternpm-publish-latestonmainpushes. - Create (or reuse) a
v<package.json version>tag and create a GitHub Release with--generate-notes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| TAG="v$(node -p "require('./package.json').version")" |
There was a problem hiding this comment.
The TAG assignment uses nested double quotes (TAG="v$(node -p "...")"), which will break bash parsing because the inner quotes terminate the outer quoted string. Use single quotes for the Node expression (or drop the outer quotes / escape the inner quotes) so the workflow can compute TAG correctly.
| TAG="v$(node -p "require('./package.json').version")" | |
| TAG=v$(node -p 'require("./package.json").version') |
| github-release: | ||
| needs: [npm-publish-latest] | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
There was a problem hiding this comment.
github-release can run even when the actual npm publish step was skipped (e.g., it’s conditional on github.actor in npm-publish-latest, but this job isn’t). That can produce a GitHub Release/tag for a version that wasn’t published to npm. Consider mirroring the same actor condition here (or keying off an output from npm-publish-latest that indicates whether publishing occurred).
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' |
No description provided.