Repository navigation
ci: token-less npm releases via Trusted Publishing (OIDC) - #25
Merged
Merged
Conversation
Replace the NPM_TOKEN-based release with token-less publishing through GitHub OIDC. Remove the setup-node registry-url (it writes an _authToken .npmrc that npm prefers over the OIDC exchange), install npm>=11.5.1 (pnpm delegates the publish to the npm CLI, which performs the exchange), and enable provenance. Add RELEASING.md.
size-limit report 📦
|
Coverage Report
File CoverageNo changed files found. |
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
Switch the
canuprelease workflow from anNPM_TOKENsecret to token-less publishing via npm Trusted Publishing (OIDC), with provenance. No long-lived npm token lives in this repo anymore.Changes
.github/workflows/release.ymlNPM_TOKENfrom the publish env.registry-urlfromsetup-node— it writes an.npmrcwith_authToken=${NODE_AUTH_TOKEN}that npm prefers over the OIDC exchange (a documented cause ofE404on publish).npm install -g npm@latest— Trusted Publishing needs npm ≥ 11.5.1, and pnpm delegates the publish (and the OIDC token exchange) to the npm CLI; GitHub runners ship an older npm. This is the most common silent-failure cause.NPM_CONFIG_PROVENANCE: true— available because this is a public repository.RELEASING.md— how releases work + one-time maintainer setup.The Changesets flow is unchanged: PRs carry changesets → a "Version Packages" PR is opened → merging it publishes.
Required one-time setup (maintainer, on npmjs.com)
Trusted Publishing requires the package to exist before a publisher can be attached, so:
canuponce manually:pnpm install && pnpm build && npm publish --access public(completes 2FA).sparkncraftcanuprelease.yml(filename only, not a path)NPM_TOKENrepo secret can be deleted.Scope
Touches only release CI + docs.
lint/typecheck/test/buildwere run locally and pass; nothing in the package output changes.