feat: publish 1.2.x to public npm via trusted publishing - #782
feat: publish 1.2.x to public npm via trusted publishing#782kaviththiranga wants to merge 1 commit into
Conversation
Backports the 1.3.0 cutover so 1.2.x patches land on the public npm registry with provenance instead of GitHub Packages. Deliberately does not bump Yarn: publishing goes through yarn pack plus npm publish, and 4.4.1 packs identically, so this line keeps its pinned toolchain. Verified locally — 23 tarballs, no workspace: leaks, deps rewritten to concrete ranges. Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Backport of #771 to
release-v1.2, so patches on this line publish to the public npm registry with provenance instead of GitHub Packages.Why this is needed
v1.2.5was tagged from this branch, which still runs the pre-cutover workflow — so all 23 packages are missing1.2.5on npm whilelatestsits at1.2.4. Without this backport, every future1.2.xpatch repeats that and needs a manual backfill.What changed
.github/workflows/release.yml— split intobuild/publish-npm/retag-image, matchingmain.buildinstalls and packs with no OIDC access;publish-npmholdsid-token: writebut does not check out the repo or install anything, so no dependency lifecycle script runs while the token is reachable. Adds aworkspace:leak gate that fails the release before anything reaches the registry.package.jsonfiles — droppedpublishConfig.registry. This is load-bearing: npm readspublishConfigfrom inside the tarball and it beats the--registryflag (npm/cli#6400), so leaving it would push straight back to GitHub Packages..npmrc— removed the GitHub Packages auth and scope lines..changeset/config.json—access: restricted→public.README.md/CONTRIBUTING.md— install and release docs. Also drops@openchoreo/backstage-plugin-apifrom the install instructions; that package does not exist on npm or in this workspace.Deliberately NOT bumping Yarn
mainmoved to Yarn 4.18 becauseyarn npm publishonly learned OIDC in 4.10. This backport does not need that: publishing goes throughyarn pack+npm publish, and 4.4.1 packs identically. Keeping the pinned toolchain avoids a 14-minor-version jump on a stable line.Verified locally on this branch with Yarn 4.4.1:
No npm-side changes needed
Trusted publishers key on repository + workflow filename + environment — not branch — and all 24 are already configured for
release.yml/npm-publish. The environment’s deployment rule istag: v*, which already coversv1.2.6.Dist-tag behaviour
Unchanged and already correct for a back-line: once
1.3.0holdslatest, av1.2.6tag publishes underrelease-1.2rather than stealinglatest. Before1.3.0ships it would takelatest, which is also correct.Note on 1.2.5
This PR does not publish
1.2.5— that version was built by the old workflow and exists only on GitHub Packages. It can be backfilled separately withscripts/migrate-gh-packages-to-npmjs.js --since 1.2.5, or left as a GitHub-Packages-only version. Either way1.2.6onward publishes correctly from this branch.