Skip to content

ci: publish via npm Trusted Publishing (CONTXT-22348) - #521

Open
omegafury wants to merge 2 commits into
mainfrom
CONTXT-22348-npm-trusted-publishing
Open

ci: publish via npm Trusted Publishing (CONTXT-22348)#521
omegafury wants to merge 2 commits into
mainfrom
CONTXT-22348-npm-trusted-publishing

Conversation

@omegafury

@omegafury omegafury commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why

CONTXT-22348, under CONTXT-22345: the org npm token behind NIO_NPM_TOKEN is dead (npm whoami → 401), so the next release of @ndustrial/contxt-sdk would tag and create a GitHub release and then fail to publish. Trusted Publishing removes the token from the equation.

What changed

  • publish.yaml publishes on the GitHub release that release.yaml creates, or by hand with a tag. Authenticates with OIDC (id-token: write, environment: npm), pins npm@11 (OIDC needs ≥ 11.5; npm 12 wants a newer Node than .nvmrc), runs npm publish with no _authToken.
  • release.yaml no 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:

Field Value
Organization or user ndustrialio
Repository contxt-sdk-js
Workflow filename publish.yaml
Environment name npm
Allow npm publish checked

Verifying

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 real feat:/fix: release then publishes for real.

🤖 Generated with Claude Code

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>
@omegafury
omegafury requested a review from a team as a code owner September 4, 2026 20:31
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>
@omegafury

Copy link
Copy Markdown
Contributor Author

Trusted publisher created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants