ci: publish via npm Trusted Publishing (CONTXT-22348) - #521
Open
omegafury wants to merge 2 commits into
Open
Conversation
The org npm token is dead, so the release job would bump, tag and create a release and then fail at publish. publish.yaml now runs on that release (or by hand with a tag) and authenticates with OIDC; release.yaml keeps the version bump and GitHub release only. prepare (gulp build) still runs under npm ci, so lib/ is built before publish. CONTXT-22348. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
faker.hacker.noun() / adjective() sometimes return two words ("solid
state", "hard drive"). The spec builds the expected redirectUri with
the WHATWG URL class, which percent-encodes the space, while the
implementation uses url-parse, which does not, so the assertion flaked
whenever faker picked a multi-word value (CI run 33916634026).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
Trusted publisher created |
zebehringer
approved these changes
Sep 4, 2026
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-22348, under CONTXT-22345: the org npm token behind
NIO_NPM_TOKENis dead (npm whoami→ 401), so the next release of@ndustrial/contxt-sdkwould 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 thatrelease.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.release.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/contxt-sdk→ Settings → Trusted Publisher → GitHub Actions:ndustrialiocontxt-sdk-jspublish.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