Fix npm publish workflow for trusted publishing #143
Merged
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.
Cloeses https://github.com/o1-labs/o1js-site/issues/3.
Sibling of PR #142.
Summary
Remove
registry-urlfromactions/setup-node: it generates an.npmrcthat conflicts with npm's OIDC trusted publishing authenticationAdd
--provenancetonpm publish: signs the package with a build attestation linking it to this repo and workflowAdd
workflow_dispatchtrigger: allows manual publishes from the GitHub Actions UINOTE:
--provenance. Without it, theid-token: writepermission is set up but never actually used. The OIDC token gets requested butnpm publishdoesn't attach it as a signed attestation to the package. So it's a fix on top of what PR fix: release workflow #142 had.Publishing process
Pre-release steps
package.json(e.g.npm version patch/minor/major)git tag v<version>(e.g.git tag v0.1.0)git push origin main --tagsThe workflow triggers automatically on the
v*tag push. It will:npm ci)npm run build)npm test)Alternatively, you can trigger the workflow manually from the Actions tab using "Run workflow" on any branch.
Prerequisites
package.jsonmust not already be published on npmTest plan
workflow_dispatchto verify it authenticates and publishes correctlynpmjs.comshows provenance information