Repository navigation
Stage npm releases from GitHub Actions - #24
Merged
Merged
Conversation
Publishing a GitHub release whose tag equals package.json's version runs the new Publish workflow. It builds, tests and packs, then stages the tarball on npm through OIDC trusted publishing, with provenance. Nothing goes live until an npm maintainer approves it with 2FA. Bumps the version to 0.5.5 for the first release through this path. Co-Authored-By: Claude Opus 5.5 <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.
Summary
Sets up npm publishing the way growombud/omnesiac#17 did.
Publishing a GitHub release whose tag matches
package.json's version runs a new Publish workflow. The workflow stages the package on npm. Nothing goes live until an npm maintainer approves it with 2FA.publish.ymland thenpmenvironment, and is limited tonpm stage publish..github/workflows/publish.ymlmaster.--ignore-scripts. No dependency has an install script, so this costs nothing.yarn ci-test, packs the tarball and uploads it as an artifact.id-token: write, and it runs in thenpmenvironment.npm stage publish --provenance.0.5.5-rc.0go to thenextdist-tag instead oflatest.build.yml. Credentials aren't persisted on checkout, and no dependency cache is used.README
gh release create <version>, then approve on npm.package.json0.5.5for the first release through this workflow.Repo settings (already applied)
npmenvironment deploys only from tags matching*.*.*.GITHUB_TOKENis read-only, and Actions can't create or approve PRs.masterruleset requires a PR and a passingBuildcheck, and blocks force-pushes and deletion. Admins can bypass.masteris deleted, because the ruleset replaces it. The one thing dropped is "require branches to be up to date", which matches omnesiac.Still to do on npmjs.com (package owner)
growombud/prolly/publish.yml/ environmentnpm, allowed actions stage only. Do this before the first release. These fields can't be edited later.boatmemeis currently the only one, so approvals rest on one account.Test plan
actionlintis clean on both workflowsv-prefixed tag and a commit not onmasterare each rejected. A prerelease version maps tonext.npm packoutput contains onlyindex.js,LICENSE,README.mdandpackage.jsonnpm stage publish <tarball> --dry-run --tag nextaccepts the packed tarball (npm 11.19)yarn ci-testpasses locally0.5.5, confirm it stages underlatestwith provenance attached, then approve or reject it🤖 Generated with Claude Code