Skip to content

ci(release): publish the CLI to npm through trusted publishing - #93

Merged
mrgoonie merged 1 commit into
mainfrom
ci/npm-trusted-publishing
Oct 16, 2026
Merged

mrgoonie merged 1 commit into
mainfrom
ci/npm-trusted-publishing

Conversation

@mrgoonie

Copy link
Copy Markdown
Contributor

Summary

Switch the skillx-sh CLI release to npm trusted publishing. The publish job exchanges its GitHub OIDC token for a short-lived npm credential, so the long-lived NPM_TOKEN secret is no longer used.

  • The publish job gets id-token: write and contents: read.
  • npm is upgraded to 11, since trusted publishing needs npm 11.5.1 or newer and Node 22 ships npm 10.
  • pnpm pack rewrites the workspace: ranges, then npm publish uploads the tarball. Provenance is attached automatically.
  • packages/cli/package.json now declares repository (with directory), which provenance verification requires.

Before merging

Configure the trusted publisher on npmjs.com, under skillx-sh → Settings → Trusted publishing → GitHub Actions:

  • Organization or user: nextlevelbuilder
  • Repository: skillx
  • Workflow filename: release-cli.yml
  • Environment: leave empty

If this merges before that is configured, the next release's publish step fails with 401/404 and nothing is published.

Context: npm still has 0.3.0 while main is already 0.4.1, so the 0.4.x releases never reached npm. #62 (0.5.0) publishes through this path once it merges.

Verification

pnpm install --frozen-lockfile and pnpm pack in packages/cli produce skillx-sh-0.4.1.tgz, whose package.json contains repository. The OIDC exchange itself can only be verified by a real release run.

🤖 Generated with Claude Code

Publish with the job's OIDC token instead of a long-lived NPM_TOKEN. The publish job gets id-token: write, upgrades npm to 11 (trusted publishing needs 11.5.1+), packs with pnpm so workspace ranges are rewritten, and publishes the tarball with npm, which attaches provenance. The package now declares its repository, which provenance verification requires.
@mrgoonie
mrgoonie merged commit e57be57 into main Oct 16, 2026
1 check passed
@mrgoonie
mrgoonie deleted the ci/npm-trusted-publishing branch October 16, 2026 02:51
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