ci: publish via npm Trusted Publishing (CONTXT-22349) - #532
Merged
Merged
Conversation
publish.yaml already ran on releases; it now authenticates with OIDC instead of JS-DevTools/npm-publish and the dead org token, takes a tag for manual re-runs, and fires on any published release. build.yaml drops an env block referencing a secret that does not exist. CONTXT-22349. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
omegafury
requested review from
aleks-ndustrial,
ben-fussell,
gwinchesters and
zebehringer
and removed request for
aleks-ndustrial and
ben-fussell
September 4, 2026 20:31
zebehringer
approved these changes
Sep 4, 2026
Contributor
Author
|
Trusted pubisher set up |
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.
Why
CONTXT-22349, under CONTXT-22345: the org npm token behind
NIO_NPM_TOKENis dead (npm whoami→ 401), so the next release of@ndustrial/node-distributed-lockwould tag and create a GitHub release and then fail to publish. Trusted Publishing removes the token from the equation.What changed
publish.yamlpublishes on the GitHub release thatbuild.yamlcreates, or by hand with a tag. Authenticates with OIDC (id-token: write,environment: npm), pinsnpm@11(OIDC needs ≥ 11.5; npm 12 wants a newer Node than.nvmrc), runsnpm publishwith no_authToken.build.yamlno longer publishes; it keeps the version bump, tag and GitHub release. Splitting them is what makes a failed publish retryable by one dispatch instead of a new commit.Same shape as postgraphile-upsert-plugin/publish.yaml, which published 0.0.2 this way today.
After merge (npm side, any package maintainer)
npmjs.com →
@ndustrial/node-distributed-lock→ Settings → Trusted Publisher → GitHub Actions:ndustrialionode-distributed-lockpublish.yamlnpmnpm publishVerifying
Dispatch Publish with the current latest tag. It will fail with
EPUBLISHCONFLICT("cannot publish over previously published version") — that error comes after authentication, so reaching it proves OIDC works. The next realfeat:/fix:release then publishes for real.🤖 Generated with Claude Code