ci: publish to npm when a GitHub Release is published - #14
Merged
Conversation
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.
Replaces the manual-dispatch release with the same trigger the codeplain repo uses:
on: release: [published].Fixes
GH006: Protected branch update failedon run 31116826023 by removing the push entirely. Nothing writes tomain, so branch protection is never in the way — and no secret is needed to get around it.The release flow
Cut a GitHub Release tagged
vX.Y.Z. The workflow then:package.jsonin the runner onlyThe tag is the source of truth
Same model as the Python side, where hatch-vcs derives the version from the tag. npm has a
package.json, so the version is written in the runner immediately before publish and never committed back — which is what keeps this free of release commits and secrets.The tradeoff, stated plainly:
package.jsononmainstays at1.0.19and stops tracking what's on npm. The tag and the npm registry are authoritative; the file is scaffolding.Also in this PR
nextdist-tag, so marking a release as a pre-release on GitHub keepslateststable.publishdrops tocontents: read— no tag pushing, no release creation, no PR opening. Onlyid-token: writeremains.ci.ymlno longer needs therelease/**push trigger, andpr-notify.ymlno longer needs to filter bot PRs.Repo settings
allow_auto_merge/delete_branch_on_mergewere enabled while exploring the previous approach; harmless to leave on, happy to turn them back off.