Skip to content

ci: publish canary releases via npm trusted publishing (OIDC) - #536

Merged
humble-little-bear merged 1 commit into
developfrom
ci/canary-trusted-publishing
Oct 8, 2026
Merged

humble-little-bear merged 1 commit into
developfrom
ci/canary-trusted-publishing

Conversation

@humble-little-bear

Copy link
Copy Markdown
Collaborator

Why

The canary run for v0.5.x (run 37733931253, e105a08) got through install and build, then failed at npm publish with E404 Not Found - PUT https://registry.npmjs.org/@offckb%2fcli. The registry is rejecting the NPM_AUTH_TOKEN secret. A trusted publisher (GitHub Actions, ckb-devrel/offckb, workflow canary-publish.yml, no environment, npm publish allowed) is now configured on npmjs.com for @offckb/cli, so canary releases can authenticate with OIDC and no longer need a long-lived token.

Changes (.github/workflows/canary-publish.yml only)

  • Permissions: id-token: write, which OIDC requires, and contents: read, replacing the unused contents: write.
  • Node 24: the job runs on 24.x, which bundles npm 11. Trusted publishing needs Node >= 22.14 and npm >= 11.5.1. A small guard step upgrades npm to ^11.5.1 only if the bundled one is older.
  • No token: NODE_AUTH_TOKEN / secrets.NPM_AUTH_TOKEN are removed from the publish step. registry-url is still set on setup-node.
  • Unchanged: pnpm is still pinned through pnpm/action-setup@v4 (version 10) with pnpm install --frozen-lockfile. The -canary-<sha> version suffix and --tag canary work as before. No caching was added.
  • Provenance: generated automatically by trusted publishing, since both the repo and the package are public.

Locally, pnpm build and test:ci pass on Node 24.21.0. The only test failures are the 2 known lsof environment failures. engines.node is >=20.0.0.

publish.yml is intentionally unchanged, because no trusted publisher is configured for it yet. An empty changeset is included for Verify Changeset.

After merge

Merge develop into v0.5.x with a merge commit to trigger the canary. The trusted publisher config expires if its first successful publish doesn't happen within 2 days.

The NPM_AUTH_TOKEN secret is rejected by the registry (E404 on PUT),
so switch canary-publish.yml to npm trusted publishing (GitHub OIDC):

- grant id-token: write (contents: read is all the job needs)
- run the job on Node 24, which bundles npm 11; guard that npm is
  >= 11.5.1 before publishing
- drop NODE_AUTH_TOKEN from the publish step so no stale token is used

Provenance is generated automatically. publish.yml is unchanged until
a trusted publisher is configured for it.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 310e6bd4-debd-4a72-97ee-8a4181560c65
📥 Commits

Reviewing files that changed from the base of the PR and between 410ef98 and a847ef0.

📒 Files selected for processing (2)
  • .changeset/canary-trusted-publishing.md
  • .github/workflows/canary-publish.yml
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@humble-little-bear
humble-little-bear merged commit ed54e1c into develop Oct 8, 2026
7 checks passed
@RetricSu
RetricSu deleted the ci/canary-trusted-publishing branch October 8, 2026 06:50
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.

1 participant