Skip to content

ci: stage npm releases for maintainer approval (fixes E404 on publish) - #22

Merged
Be1newinner merged 1 commit into
mainfrom
ci/stage-npm-releases
Oct 27, 2026
Merged

Be1newinner merged 1 commit into
mainfrom
ci/stage-npm-releases

Conversation

@Be1newinner

Copy link
Copy Markdown
Owner

Problem

The first Release run (from #21) failed at npm publish with E404. The trusted publisher on npm is configured stage-only, as npm recommends: it doesn't allow direct npm publish. npm reports a rejected publish as a 404.

This fix was pushed to #21's branch after #21 had already merged, so it never reached main. That run failed before tagging, so nothing was published or tagged. npm still shows latest: 3.0.0.

Fix

  • Stage instead of publish: releases now use npm stage publish, which trusted publishers are always allowed. Nothing goes live until the maintainer approves it on npmjs.com, with 2FA.
  • Newer npm: the workflow upgrades to npm 11, since npm stage needs 11.15 or newer.
  • Tag and draft release: when a version is staged, it gets a vX.Y.Z tag and a draft GitHub release. The job summary explains how to approve or reject.
  • Pending approvals: the previous release is now the highest of npm's version and the v* tags. A push made while a release is still waiting stages the next patch instead of failing, since npm can't stage the same version twice.
  • Docs: CONTRIBUTE.md documents approving (Staged Packages tab, or npm stage approve <id>) and rejecting.

The versioning rules are unchanged: patch is automatic, minor needs the maintainer's manual run, major is never automated.

After merging

  • The merge stages 3.0.1. Approve it on npmjs.com, on the package's Staged Packages tab.
  • To release 3.1.0 instead, reject the staged 3.0.1 and run the Release workflow with bump: minor.

Test plan

  • Version script on this branch: 3.0.0 → 3.0.1
  • Scratch-clone test: a push while v3.0.1 is staged but npm still says 3.0.0 → 3.0.2
  • npm stage publish --dry-run --access public accepts the flags and packs the same 67 files
  • The first real staged release, after merging

🤖 Generated with Claude Code

https://claude.ai/code/session_015pLhuJbdhCyvDro7o6h1wp

npm trusted publishing recommends stage-only permissions, so releases now
use `npm stage publish`: nothing goes live until the maintainer approves
it on npmjs.com (2FA). The workflow upgrades to npm 11 (stage needs
>= 11.15), tags the version when staged and creates a draft GitHub
release.

A staged version can't be staged again, so the previous release is now
the highest of the npm version and the vX.Y.Z tags: a push made while a
release awaits approval stages the next patch instead of failing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015pLhuJbdhCyvDro7o6h1wp
@Be1newinner
Be1newinner merged commit b2e941f into main Oct 27, 2026
8 checks passed
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