@@ -295,26 +295,53 @@ jobs:
295295 - name : Verify all packages exist on npm
296296 uses : ./.github/actions/verify-npm-packages
297297
298- - name : Publish new version
298+ # Version bump only — no publish. Separated from publishing (WCN-1818) so the
299+ # two-phase publish below can run identically whether this step just bumped
300+ # versions (normal path) or recovery-mode skipped it (rel/latest already
301+ # holds the versions to resume from).
302+ - name : Bump version
299303 if : ${{ inputs.dry-run == false && !inputs.recovery-mode }}
300304 run : |
301- yarn lerna publish --sign-git-tag --sign-git-commit --include-merged-tags --conventional-commits --conventional-graduate --yes
305+ yarn lerna version --sign-git-tag --sign-git-commit --include-merged-tags --conventional-commits --conventional-graduate --yes
306+
307+ # Two-phase publish (WCN-1818): bitgo's `prepack` script resolves its
308+ # siblings from the registry, but a single combined `lerna publish` packs
309+ # every package's lifecycle hooks before uploading any of them — so bitgo
310+ # would try to resolve siblings that aren't live yet (this is what broke
311+ # `npm install bitgo` for every consumer, WCI-1200). Hold bitgo back
312+ # (private), publish siblings first, then restore and publish bitgo alone
313+ # once its siblings are actually resolvable. Runs identically for the
314+ # normal path (after the version bump above) and the recovery path (no
315+ # preceding bump) — `from-package` only publishes what's missing from npm
316+ # either way, so re-running is idempotent.
317+ - name : Hold back bitgo umbrella for the siblings publish pass
318+ if : inputs.dry-run == false
319+ run : npx tsx ./scripts/set-umbrella-publishable.ts false
320+
321+ - name : Publish siblings (pass 1)
322+ if : inputs.dry-run == false
323+ run : |
324+ # `from-package` reads each package.json's `version`, queries npm,
325+ # and publishes only versions missing from the registry.
326+ yarn lerna publish from-package --yes
302327 env :
303328 NPM_CONFIG_PROVENANCE : true
304- # Tells bitgo's `prepack` script (scripts/generate-bitgo-shrinkwrap.ts) to
305- # actually generate npm-shrinkwrap.json — kept opt-in so a plain local
306- # `npm pack` doesn't force a network install of the full dependency tree.
307- BITGO_GENERATE_SHRINKWRAP : true
308329
309- - name : Publish missing versions (recovery)
310- if : ${{ inputs.dry-run == false && inputs.recovery-mode }}
330+ - name : Restore bitgo umbrella for its own publish pass
331+ if : ${{ always() && inputs.dry-run == false }}
332+ run : npx tsx ./scripts/set-umbrella-publishable.ts true
333+
334+ - name : Publish bitgo (pass 2)
335+ if : inputs.dry-run == false
311336 run : |
312- # `from-package` reads each package.json's `version`, queries npm,
313- # and publishes only versions missing from the registry. No bump,
314- # no tag, no git push.
315337 yarn lerna publish from-package --yes
316338 env :
317339 NPM_CONFIG_PROVENANCE : true
340+ # Tells bitgo's `prepack` script (scripts/generate-bitgo-shrinkwrap.ts) to
341+ # actually generate npm-shrinkwrap.json — kept opt-in so a plain local
342+ # `npm pack` doesn't force a network install of the full dependency tree.
343+ # Siblings published in the pass above are live on the registry by now,
344+ # so resolution succeeds.
318345 BITGO_GENERATE_SHRINKWRAP : true
319346
320347 - name : Verify recovery published the missing versions
0 commit comments