ci: trigger release on version tag push (v*) - #33
Closed
arv wants to merge 1 commit into
Closed
Conversation
The release pipeline now runs when a `v*` tag is pushed, matching the manual release flow (`npm version <type>` + push tag) rather than requiring a manually created GitHub Release. - on: add `push.tags: ['v*']`; drop the `release` trigger. - publish + prebuild jobs: gate on `startsWith(github.ref, 'refs/tags/v')`. - prebuild jobs: add `contents: write`. `prebuild -u` creates the GitHub release and uploads the .node assets, which needs write access (this repo's default workflow token is read-only). publish keeps `id-token: write` for OIDC provenance (npm publish --provenance). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Closing — going with the existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the release pipeline run when a
v*tag is pushed, so the manual flownpm version <type>+git push --tagscuts a release (npm publish with provenance + prebuilt binaries).Changes
on:— addpush.tags: ['v*']; remove thereleasetrigger.publish+ allprebuild*jobs — gate onstartsWith(github.ref, 'refs/tags/v')instead ofgithub.event_name == 'release'.prebuild*jobs — addpermissions: contents: write.prebuild -ucreates the GitHub release and uploads the.nodeassets (seeprebuild/upload.js), which needs write access; this repo's default workflow token is read-only.publishkeepsid-token: writefor OIDC provenance.Release flow after this merges
Important
A tag only triggers the workflow version present at the tagged commit, so this must be on
mainbefore a tag push will do anything.Then, to cut a release:
mainis protected (PRs only), so the bump commit can't be pushed tomaindirectly — only the tag. The publish job checks out the tag, so the published version is correct;main'spackage.jsoncan be synced with a follow-up PR (or do the bump via PR first, then tag the merged commit).🤖 Generated with Claude Code