fix(release): sudo npm install -g for Trusted Publishing upgrade - #50
Conversation
The v0.1.3 run built all 6 targets, uploaded assets, and updated the Homebrew formula, but publish-npm failed at the very first step: 'npm install -g npm@latest' hit EACCES on /usr/local/share/man/man7. The global npm prefix (/usr/local) is root-owned on ubuntu runners, so installing a new global npm needs sudo. Without the upgrade npm stays at 10.x and Trusted Publishing (needs >= 11.5.1) can't authenticate via OIDC. This was the next latent failure exposed now that upload + Homebrew finally run end-to-end.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn the ChangesCI Workflow: npm Upgrade with sudo
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Up to standards ✅🟢 Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Problem
The v0.1.3 run made it almost all the way: all 6 targets built,
upload-release-assets✅ (theGH_REPOfix worked), andupdate-homebrew-formula✅. Onlypublish-npmfailed — at its very first step:The global npm prefix (
/usr/local) is root-owned on GitHub's ubuntu runners, so installing a new global npm needssudo. Without the upgrade, npm stays at 10.x and Trusted Publishing (requires npm ≥ 11.5.1) can't authenticate via OIDC.This was the next latent failure, exposed only now that upload + Homebrew finally run end-to-end (the whole
publish-npmjob had never executed past this step before).Fix
sudo npm install -g npm@latest.The rest of
publish-npmwas reviewed and looks correct:gh release downloadalready passes--repo, the generator runs against the downloaded assets, and the OIDC publish (no token,id-token: write, trusted publisher configured + verified on all 7 packages) needs only the upgraded npm.Recovery
v0.1.3 failed before any
npm publish, so nothing was half-published. Merging thisfix:cuts 0.1.4, which should finally publish all 7 packages to npm via OIDC. v0.1.3's empty-on-npm tag will be cleaned up with the others.Test plan
Summary by cubic
Use sudo to upgrade global
npmin the release workflow to meet Trusted Publishing’s >=11.5.1 requirement and avoid EACCES on GitHub runners..github/workflows/release-please.ymlto runsudo npm install -g npm@latestbeforepublish-npm.npmversion.Written for commit 1627548. Summary will update on new commits.
Summary by CodeRabbit