ci: publish to npm with the npm CLI instead of pnpm - #213
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
4.0.0release-please run taggedpackage-v4.0.0and created the GitHub Release, but the publish job failed: it built and signed provenance, then died on the upload with404 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
PUTgoes 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_dispatchtrigger (and lets thepublishjob run on it), so the already-tagged4.0.0can 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_apiand workflow filerelease-please.yml.