fix(ci): publish workspaces one at a time, skipping what is already out - #8
Merged
Merged
Conversation
`npm publish --workspaces` stops at the first package it cannot publish, so a token whose granted packages do not cover the unscoped `dorval` took the whole release down with it: v0.10.3, v0.10.4 and v0.10.5 each got a tag, a GitHub release and their @dorval/* packages, while the CLI stayed at 0.10.2 on npm and the workflow reported failure with no indication of which half had landed. Publish each package on its own, skip versions already on the registry, and report published/skipped/failed at the end. A real problem still fails the build, but a re-run now picks up whatever was missed instead of tripping over the packages that did go out. Also points manual-publish at the same script - its per-package steps had drifted, tolerating a failure from dio and custom but not from core or the CLI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
Every release since v0.10.3 has reported failure while landing about half of itself.
@dorval/core,dio,customon npmdorval(the CLI) on npmdorvalon npm is still 0.10.2, published 2026-01-21. Anyone runningnpm i dorvaltoday gets the January build — none of the enum fixes from #6, none of the date-format fixes from #7.The workflow run says
failurewith no indication of which half went out. From the log of the v0.10.5 run:Root cause, in two parts.
The 403 itself is a credentials problem, not a code problem. The same
secrets.NPM_TOKENpublishes all three@dorval/*packages successfully and is refused on the unscopeddorval. Bothdorvaland@dorval/corelist the same owner (wildstorm), so this is not a missing maintainer — it is a granular access token whose granted packages cover the@dorvalscope but not the separate, unscopeddorvalpackage name. That part cannot be fixed from this repo, see the checklist below.Everything else about the failure is this repo's doing.
publishCmdwas:One command for all four packages, and it stops at the first one it cannot publish. So a single package the token has no rights to:
dorvalhappened to sort last, which is the only reasondioandcustomgot out at all;Change
scripts/publish-workspaces.sh, called from both publish paths. Per package:name@versionis already on the registry;published/skipped/failedat the end, and exit non-zero if anything failed, so a real problem still fails the build.@dorval/coreis published first explicitly — the CLI depends on it, and the old code relied on how the glob happened to sort.private: truepackages are skipped.Skipping what is already out is what makes a re-run useful: once the token covers
dorval, re-running picks up only the package that was missed.manual-publish.ymlnow calls the same script. Its per-package steps had drifted from the semantic-release path and from each other — a failure fromdioorcustomwas tolerated with|| echo, the same failure fromcoreor the CLI was fatal.Tests
Registry reads are real here, so the skip logic was verified against the live registry (nothing was published —
npm publishonly ran under--dry-run):That is exactly the recovery shape wanted: the three packages already out are left alone, and the one missing package is the only thing attempted.
packages/core: 450 tests pass..releaserc.jsonand both workflow files validated as JSON/YAML.What is not verified: real publishing. I have no credentials for this registry, so the
npm publishcall itself was only exercised with--dry-run. The ordering, the skip decision, the failure collection and the exit code are verified; the authenticated upload is not.To actually get the CLI published
This PR stops the failure from being silent and makes recovery possible. It does not grant permissions — that step is manual:
secrets.NPM_TOKEN→ Packages and scopes → add thedorvalpackage (a token scoped to@dorvaldoes not carry it). Alternatively use a token with write access to both.0.10.5, or locally withnpm login && bash scripts/publish-workspaces.sh— the three@dorval/*packages will be skipped and onlydorval@0.10.5goes out.Notes
v0.10.3 has a tag and a CHANGELOG entry but nothing on npm at all — the
@dorval/*packages jump straight from 0.10.2 to 0.10.4. Worth deciding whether to leave that gap or re-tag; this PR does not touch it.The GitHub release for v0.10.3 and v0.10.4 is also missing while v0.10.5 has one, which fits the
publishstep dying before@semantic-release/githubon those two runs. Nothing here changes plugin order, so that resolves on its own once publishing stops failing.