ci(release): add tag-driven publish pipeline - #2
Merged
Conversation
release-it now only decides the version, writes CHANGELOG.md and pushes the tag. Building, publishing and the GitHub release move to CI, where npm authenticates over OIDC instead of a long-lived token. The publish step is skipped when the version is already on npm, so the by-hand first release can still push its tag through the same pipeline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
There was no release pipeline: version
0.0.0, no tags, noCHANGELOG.md, andrelease-itstill on thecreate-react-native-librarydefaults — publishing to npm from a laptop with a long-lived token.This splits the release in two: local decides the version, CI builds and publishes.
What changed
.github/workflows/release.yml(new), triggered onv*tags:verify— lint,format:check, typecheck, unit tests.publish— needsverify, runs withid-token: writeso npm authenticates over OIDC:package.json;yarn prepare, then grepslib/for@/— the repo's non-negotiable is now a release gate;npm publish --provenance --access public, skipped when the version is already on npm;gh release createwith the top section ofCHANGELOG.mdas notes.package.json—release-itstops publishing:npm.publishtruefalse— CI publishesgithub.releasetruefalse— CI creates itgit.requireBranchmainconventional-changelog.infileCHANGELOG.mdThe first release is by hand
npm requires a package to exist before a trusted publisher can be registered, so
0.1.0goes up manually. That is why the publish step skips an already-published version — the first tag still flows through the same pipeline and gets its GitHub release.yarn release --no-git.push→ pick minor,0.1.0yarn prepare && npm publish --access publicSalve-Software/react-native-cicerone, workflowrelease.ymlgit push --follow-tagsFrom
0.2.0on it is justyarn release; no npm token ever lives in the repository.Worth a second opinion
release-itcommits and pushes the version bump straight tomain. Ifmainhas branch protection blocking pushes, step 5 fails and the protection needs a bypass for the release author.🤖 Generated with Claude Code