Repository navigation
ci(publish): stage, tag and release on a package.json version bump - #53
Merged
Merged
Conversation
Merging a version bump to main now runs publish.yml: gates, npm stage publish, then tag v<version> on the merged commit and create the GitHub release with the matching CHANGELOG section as notes (prerelease when the version has `-`). A package.json push whose tag already exists does nothing. The release trigger is removed, so a release no longer re-stages the same version; workflow_dispatch stays as the manual re-stage fallback. The workflow file name is unchanged: npm Trusted Publisher is bound to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
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
publish.ymlnow runs when apackage.jsonchange lands onmain, instead of when a GitHub release is published.resolvejob: reads the version and checks whetherv<version>already exists on the remote. If it does (for example a dependency-onlypackage.jsonchange), nothing else runs.publishjob, when the tag is missing:## <version>CHANGELOG section. If it's missing or empty, the job fails before staging anything.vp check,vp testandvp run smoke.vp pm stage publish. The dist-tag logic is unchanged.gh release create v<version> --target <merged sha>with that CHANGELOG section as the notes. A version with a-becomes a prerelease (not latest); otherwise the release is marked latest.workflow_dispatch: kept as the manual way to re-stage. It also creates the tag and release if they're missing.publishconcurrency group means two quick merges don't race.The release flow becomes: open a release PR (bump the version, rename
## Unreleased→## <version>), merge it, then approve the staged publish with 2FA (vp pm stage approve <stage-id>).Why the release trigger is removed
With
release: published, publishing a release staged the same version a second time. 0.3.0 was already staged throughworkflow_dispatch, so a release created by hand would have staged it again. The release is now an output of the workflow, created withGITHUB_TOKEN, so it doesn't trigger other workflows.Notes
publish.yml, because the npm Trusted Publisher (OIDC) is bound to it.resolvegetscontents: read.publishgetscontents: write, to create the tag and release, andid-token: write.package.json, so merging it won't run the workflow.v0.3.0is already tagged on02da986and has a draft release. It's a draft because the old trigger would have re-staged 0.3.0. After this merges, it can be published by hand without starting a publish. Later versions are tagged and released by the workflow.preview.ymlcomment now describe the new flow.Checks
vp check: pass.0.3.0: tag exists, so the run would be skipped.🤖 Generated with Claude Code