Skip to content

ci: publish npm packages on v* tags with trusted publishing - #11

Merged
macjayz merged 1 commit into
mainfrom
ci/npm-publish
Oct 31, 2026
Merged

macjayz merged 1 commit into
mainfrom
ci/npm-publish

Conversation

@macjayz

@macjayz macjayz commented Oct 31, 2026

Copy link
Copy Markdown
Owner

What

A v* tag now publishes @heightproof/shared, @heightproof/sdk-node and @heightproof/web3 to npm in dependency order, alongside the images and Helm chart that release.yml already publishes.

  • No npm token in GitHub. It uses npm trusted publishing (OIDC) with id-token: write.
  • Provenance on every release. npm shows a verified "built from macjayz/heightproof by this workflow run" badge.
  • Guards:
    • it fails if any package version, or any exact @heightproof/* pin between packages, differs from the tag
    • it skips versions already on npm, so a failed run is safe to re-run
  • Dry run: you can trigger it manually from the Actions tab with dry_run (on by default).
  • npm version: it upgrades npm to 11.21.1, because trusted publishing needs npm 11.5.1 or later and Node 22 bundles npm 10.

RELEASING.md documents cutting a release and the one-time setup. npm only allows a trusted publisher on a package that already exists, so the first 0.1.0 publish is done by hand.

Testing

  • Parsed the workflow YAML, then extracted its steps and ran them locally:
    • the tag check passes for v0.1.0
    • it fails for v0.2.0 (version mismatch)
    • it fails for a stale internal pin
  • Ran the publish step with DRY_RUN=true. All three packages pack in the right order.
  • The real OIDC publish can only run on GitHub after the trusted publishers are configured.

🤖 Generated with Claude Code

A v* tag builds, tests and publishes @heightproof/shared, sdk-node and
web3 in dependency order. Authentication is npm trusted publishing
(OIDC), so no npm token is stored in GitHub, and every release carries
provenance.

The workflow refuses a tag that does not match every package version
or an exact internal pin, skips versions already on npm so a failed run
can be re-run, and can be dry-run from the Actions tab.

RELEASING.md covers cutting a release and the one-time setup: the first
publish by hand, then adding the trusted publisher on npmjs.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macjayz
macjayz merged commit 81b9e4d into main Oct 31, 2026
8 checks passed
@macjayz
macjayz deleted the ci/npm-publish branch October 31, 2026 21:40
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