Skip to content

ci: publish to npm with the npm CLI instead of pnpm - #213

Merged
tvdeyen merged 2 commits into
mainfrom
chore/fix-npm-publish-oidc
Sep 2, 2026
Merged

tvdeyen merged 2 commits into
mainfrom
chore/fix-npm-publish-oidc

Conversation

@tvdeyen

@tvdeyen tvdeyen commented Sep 2, 2026

Copy link
Copy Markdown
Member

The 4.0.0 release-please run tagged package-v4.0.0 and created the GitHub Release, but the publish job failed: it built and signed provenance, then died on the upload with 404 Not Found - PUT https://registry.npmjs.org/@alchemy_cms%2fjson_api.

That is the pnpm OIDC trusted-publishing bug (pnpm/pnpm#11513): pnpm generates the provenance (via sigstore, which is why that step succeeds) but does not complete the OIDC→npm auth exchange, so the tarball PUT goes out unauthenticated and npm returns 404. This publishes with the npm CLI instead — upgraded to >= 11.5.1, which implements trusted publishing correctly — while keeping pnpm for install/build.

It also adds a workflow_dispatch trigger (and lets the publish job run on it), so the already-tagged 4.0.0 can be published without waiting for a new release event.

After merge: run the workflow manually (Actions → Release Please → Run workflow) to publish 4.0.0; subsequent releases publish automatically.

If it still 404s with the npm CLI, the npmjs trusted publisher registration doesn't match — verify it targets repo AlchemyCMS/alchemy-json_api and workflow file release-please.yml.

The 4.0.0 publish failed with `404 PUT …@alchemy_cms%2fjson_api`: pnpm signs
provenance but does not complete the OIDC trusted-publishing auth exchange
(pnpm/pnpm#11513), so the upload goes out unauthenticated. Publish with the
npm CLI (upgraded to >= 11.5.1, which implements trusted publishing) instead,
keeping pnpm for install/build. Also add a `workflow_dispatch` trigger so the
already-tagged 4.0.0 can be published without waiting for a new release event.
Make each tool's role explicit: pnpm installs from the lockfile and builds a
fresh dist, and `npm publish --ignore-scripts` only uploads it (so npm does
not re-invoke the pnpm `prepare` build). Publishing a freshly built artifact
avoids shipping a stale committed dist.
@tvdeyen
tvdeyen merged commit 1d96553 into main Sep 2, 2026
9 checks passed
@tvdeyen
tvdeyen deleted the chore/fix-npm-publish-oidc branch September 2, 2026 12:38
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