Repository navigation
Release when a version tag is pushed - #112
Merged
Merged
Conversation
The release workflow ran `npm version` itself but could only push the tag, as the default branch ruleset blocks its push to main, so the version commit never landed on main. Now `npm version` runs locally, and pushing main and the new tag together runs the workflow, which: - checks that the tag is on main and matches the package version, - checks, builds, and publishes the tagged commit as before, - creates the GitHub release for the existing tag (`--verify-tag`). The release job no longer pushes anything, so `contents: write` is only needed for the GitHub release. The workflow's header documents the release steps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 |
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.
The release workflow ran
npm versionitself but could only push the tag, as the default branch ruleset blocks its push tomain, so the version commit never landed onmain. Nownpm versionruns locally, and pushing the version commit and its tag runs the workflow.How to release
On an up-to-date
main:npm versioncommits the new version and creates an annotatedvX.Y.Ztag.--follow-tagspushes that tag along withmain, and--atomicmakes the push all or nothing. As an admin, you bypass the default branch ruleset for the push tomain. The same steps are documented at the top ofrelease.yml.Changes
pushofv*tags instead ofworkflow_dispatch.buildjob checks that the tagged commit is onmain(replacing thegithub.refguard) and that the tag matchespackage.json's version, before installing anything. Then it runs the same checks and build as before.releasejob no longer configures git, runsnpm version, or pushes the tag. It publishesdistand creates the GitHub release for the existing tag with--verify-tag, socontents: writeis now only used for the release.The workflow file name is unchanged, so npm's trusted publisher config still matches.
Verification
npm version minorcreates an annotated tag, and thatgit push --atomic --follow-tags origin mainpushes both refs, or neither when the remote rejectsmain.v0.5.0's commit and fails for Full import/export handling, query variant modules, and raw TypeScript #68's head. The version check passes forv0.5.0and fails forv0.5.1on the currentpackage.json.cache-mode, which it doesn't know yet.Suggested follow-up
Now that the workflow no longer creates tags, enable Restrict creations in the
Release tagsruleset. With the admin bypass, only admins can then createv*tags, which means only admins can start a release.🤖 Generated with Claude Code