-
Notifications
You must be signed in to change notification settings - Fork 3
Add GitHub release step to CI workflow #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -79,3 +79,32 @@ jobs: | |||||
| - name: Publish to npm | ||||||
| if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' | ||||||
| run: npm publish --tag latest | ||||||
|
|
||||||
| github-release: | ||||||
| needs: [npm-publish-latest] | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||||||
| permissions: | ||||||
| contents: write | ||||||
| steps: | ||||||
| - uses: actions/checkout@v6 | ||||||
| with: | ||||||
| fetch-depth: 0 | ||||||
| - name: Create GitHub release with generated notes | ||||||
| env: | ||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| run: | | ||||||
| TAG="v$(node -p "require('./package.json').version")" | ||||||
|
||||||
| TAG="v$(node -p "require('./package.json').version")" | |
| TAG=v$(node -p 'require("./package.json").version') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github-releasecan run even when the actualnpm publishstep was skipped (e.g., it’s conditional ongithub.actorinnpm-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 fromnpm-publish-latestthat indicates whether publishing occurred).