Skip to content

ci(publish): switch to npm trusted publishing (OIDC) - #8

Merged
adamhenson merged 1 commit into
mainfrom
ci/trusted-publishing
Oct 11, 2026
Merged

adamhenson merged 1 commit into
mainfrom
ci/trusted-publishing

Conversation

@adamhenson

Copy link
Copy Markdown
Contributor

Summary

npm is removing direct publishing from bypass-2FA granular tokens in January 2027, and the current NPM_TOKEN has already expired. This switches to trusted publishing, so there's no token at all.

  • id-token: write permission, Node 24, and npm@latest (trusted publishing needs npm 11.5.1+).
  • Publishes with npm publish and no NODE_AUTH_TOKEN. Provenance is attached automatically because the repo is public.
  • Publishes before pushing the version bump commit, so a failed publish leaves main untouched. This replaces the npm whoami check, which can't work without a static token.
  • Drops the pnpm dependency cache from the release job, per npm's guidance for release builds.
  • Adds repository.directory: packages/cli for provenance.
  • Rewrites docs/publishing.md around the trusted publisher setup.

Required on npmjs.com before this works

@agentmeter/cli → Settings → Trusted Publisher → GitHub Actions: org AgentMeter, repo sdk, workflow publish.yml, allowed action npm publish. After that, delete the NPM_TOKEN secret.

Then

gh workflow run publish.yml -R AgentMeter/sdk --ref main publishes the 1.2.0 already on main.

@adamhenson
adamhenson merged commit 488320f into main Oct 11, 2026
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