Repository navigation
Release from GitHub with npm trusted publishing - #9
Merged
Merged
Conversation
- release.yml: on a published GitHub release, check the tag matches package.json, test, stage the version on npm through OIDC (no token), and move the major tag (v0). Run by hand for a dry run. - Staged, not published: a maintainer approves on npmjs.com with 2FA. - RELEASING.md: each release step by step, the one-time npm setup, and a checklist for launching the next open-source package from this template.
Merged
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
Releases no longer need
npm publishon a laptop..github/workflows/release.ymlruns when a GitHub release is published:v+ thepackage.jsonversionnpm stage publishthrough trusted publishing: npm trusts this workflow over OIDC, so no npm token is stored anywhere, and the version gets npm's provenance badge linking it to the commitv0) to the release, souses: birazzzz/wrapguard@v0gets itThe version is staged, not published: a maintainer approves it on npmjs.com (Staged Packages) with their two-factor login. That's what npm recommends for CI, and it means a compromised workflow still can't ship a version on its own.
Running the workflow by hand (Actions → Release → Run workflow) is a dry run: tests plus
npm pack --dry-run, nothing published.RELEASING.md: each release step by step, the one-time npm setup, and a checklist for launching the next open-source package with wrapguard as the template.Requirements checked against npm's docs
npm stage: the workflow uses Node 24 and updates npm to^11.15.0id-token: writepermission;contents: writefor movingv0repository.urlinpackage.jsonmatches this repoChecked locally
npm pack --dry-run: 29 files, 26.9 kB. (npm publish --dry-runrefuses a version that's already on npm, which is always true between releases, so the dry run usesnpm pack)Not verified until it runs on GitHub: the OIDC exchange and
npm stage publish. The first real test is the next release (0.2.0 with #8).Before the first release through it
On npmjs.com: wrapguard → Settings → Trusted publishing → GitHub Actions, with
birazzzz/wrapguard/release.yml, no environment, staging only.