ci: publish through npm trusted publishing - #42
Merged
Conversation
The release job gets `id-token: write` and no longer takes an npm token. `registry-url` goes with it: `setup-node` writes an `.npmrc` with an `_authToken` placeholder for it, and that placeholder shadows OIDC.
Coverage Report for CI Build 33748218849Coverage remained the same at 93.924%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
Switches the release job from an npm token to OIDC, the same way TrigenSoftware/Argue#399 did -
argue-cli@3.2.0was published through it, so the path is proven with this exact action.Three changes, and the resulting job is byte-identical to Argue's:
id-token: writeon the release job, so the runner can mint an OIDC token;npm-tokeninput dropped;registry-urldropped fromsetup-node. This one is not cosmetic: with it,setup-nodewrites an.npmrccarrying_authToken=${NODE_AUTH_TOKEN}, and that placeholder shadows OIDC - npm sees a credential and never asks for a token.Before merging
After this lands, the release job can only publish through a trusted publisher, and none is registered for any of the eleven packages yet - so the first release would fail with no credentials. Each package needs:
for
@srcset/{core,runtime,bundler-utils,cli,loader,vite-plugin,react,preact,svelte,imgproxy,cloudflare}, run with npm 11.10 or newer.Whether npm accepts the registration for a package that does not exist yet is untested. If it does, merge and release through CI. If it does not, publish once with a token first and merge this afterwards.