Skip to content

feat: npm_publish_packed, publishing packed release tarballs by trusted publishing - #43

Open
charlielye wants to merge 1 commit into
mainfrom
cl/npm-publish-packed
Open

charlielye wants to merge 1 commit into
mainfrom
cl/npm-publish-packed

Conversation

@charlielye

Copy link
Copy Markdown
Contributor

Generic port of aztec-packages' scripts/publish_npm_release, so aztec-node (and any other ci3 consumer) can stage npm tarballs in its release build and publish them from a GitHub job with npm trusted publishing, without an NPM_TOKEN.

  • npm_publish_packed <dir>: publishes every *.tgz in <dir> with --provenance --ignore-scripts --access public.
    • NPM_PUBLISH_SCOPES (required) lists the scopes the repository may publish; any other tarball is refused before anything is published.
    • EXPECTED_VERSION, or GITHUB_REF_NAME without its leading v, is the only version accepted.
    • Packages publish in dependency order (a full topological order, since aztec-node's yarn-project has multi-level chains); a cycle is refused.
    • Dist-tags follow deploy_npm: a version older than its tag's current version publishes under tmp-publish.
    • A re-run skips versions already out and reports a stale dist-tag (trusted publishing can't move tags). A staged-version 409 counts as published.
    • DRY_RUN=1 runs npm publish --dry-run.
  • npm_dist_tag <version>: the tag rule, moved out of deploy_npm so both share it. No behaviour change in deploy_npm.
  • tests/npm_publish_packed_test: 11 cases against a fake npm. deploy_npm_pack_test still passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L

…ed publishing

A release build packs its npm tarballs with deploy_npm's pack mode; npm_publish_packed publishes
them from a job holding no npm credential, using the runner's OIDC token and --provenance. It keeps
deploy_npm's dist-tag policy (now shared through npm_dist_tag), publishes each package after the
bundled packages it depends on, refuses tarballs outside NPM_PUBLISH_SCOPES or at another version,
and treats an already-published or staged version as done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
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