ci: publish to npm from a merged release PR - #205
Conversation
Verifies the tarball we are about to ship is internally consistent, by
packing it and checking two things that have actually broken here:
1. Every subpath in `exports` resolves to a file really in the tarball.
`./stores` was declared while dist/stores/ was never shipped — that
is live on npm in 1.2.11 today.
2. Every @pathscale/ui import in the README resolves. The README told
readers to import dist/styles/compat/daisy-primitives.css, which is
not in the package, so the first thing a new user copies throws.
Regression-tested against the published 1.2.11 tarball: reports exactly
those two faults and nothing else, and passes once both are fixed.
Note `*` in an exports target matches across path segments rather than
one segment, so ./styles/* correctly resolves to nested files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sixteen commits have accumulated on master since 1.2.11 was published on 2026-06-08, including the stores-export fix. Consumers are still getting a package with a broken export seven weeks after it was fixed, because releasing is manual and nobody has run it. release-please keeps a version-bump and changelog PR open; merging it tags the release and triggers publish. Ordinary pushes do nothing. Publishing uses npm Trusted Publishing (OIDC), so no NPM_TOKEN exists in this repository or anywhere else. It needs one-time setup on npmjs.com pointing the trusted publisher at this repo and workflow; until then the publish step fails closed rather than publishing unauthenticated. Gates before publish, because a version can never be reused: the package check above, publint, and @arethetypeswrong/cli. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🚀 Preview deployment is ready! You can view the preview at: https://pr-ui-preview-205.surge.sh |
release-please derives the next version from the last release it can find. This repo has no GitHub releases at all, and its newest git tag is v1.1.51 while npm is on 1.2.11 — the tags are stale and inconsistently formatted (1.1.32 and v1.1.49 both appear). Left alone it would therefore propose a version below what is already published, and npm would reject the publish. Pins the baseline in .release-please-manifest.json and moves to manifest mode. Master carries one unreleased feat (9257156, metal border engine) plus a fix and docs, so the first release this cuts is 1.3.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Added a third commit after checking what the first run would actually do. release-please would have proposed a version npm rejects. It derives the next version from the last release it can find. This repo has no GitHub releases at all, and its newest git tag is Pinned the baseline in First release this cuts will be 1.3.0 — master carries one unreleased feature ( |
Answers "what do you need to publish without manual steps" — and the answer is not a token for me.
What you do: one npm setting, no credential anywhere
npm Trusted Publishing (OIDC). GitHub Actions authenticates to npm directly, so no long-lived credential exists — not in a repo secret, not on a laptop, not in an agent's context.
One-time, ~2 minutes, nothing pasted anywhere:
Until that exists the publish step fails closed. Merging this PR cannot publish anything by accident.
What this changes
release-pleasekeeps a version-bump + changelog PR open against master. Merging it tags the release and triggers publish. Ordinary pushes to master do nothing.Your only remaining action is approving a PR that already shows you the version and the changelog. I'd argue that isn't the manual toil worth removing — your own
AGENTS.mdsays "Publishing to npm is irreversible. A version can never be reused." Keeping one cheap checkpoint on an action that can never be undone seems right, and everything mechanical around it is now automated.Why this is overdue
16 commits have landed on master since 1.2.11 was published on 2026-06-08 — seven weeks. One of them is
85e1633 fix: remove stale stores export, from 18 June. So@pathscale/ui/storesis fixed in this repo and still broken on npm, because releasing is manual and nobody ran it.package.jsonstill reads 1.2.11.That is the actual cost of manual releases here: not effort, but fixes that never reach users.
Gates before publish
A version can never be reused, so the workflow refuses to ship a package that fails:
bun run check:package(new)publint --strict@arethetypeswrong/cliPlus the existing contract check, typecheck and build.
The new check is regression-tested against the real failure
I ran it against the published 1.2.11 tarball. It reports exactly the two faults that actually shipped —
— and passes once both are fixed. It found one bug in itself along the way:
*in anexportstarget matches across path segments, not one segment, so an early version false-positived on./styles/*. Fixed and re-verified.Note on
package.jsonTouches it in one line (adds the
check:packagescript). #204 also touches it, in a different region (keywords, homepage). They should merge cleanly in either order.🤖 Generated with Claude Code