From 9374a1c09eb38f6dd5fe10f3b03c7ea9474f79bb Mon Sep 17 00:00:00 2001 From: Greg Priday Date: Tue, 20 Oct 2026 08:40:21 +0200 Subject: [PATCH] fix(ci): wait 15 minutes for npm to make a publish visible - npm now accepts a publish before the version is visible; 1.0.0-rc.4 took nine and a half minutes, and the one-minute wait failed a release that had published correctly, skipping the GitHub release - poll the registry 90 times, ten seconds apart, instead of six - bound the step at 20 minutes, so npm's own retries and request timeouts on top of the polls cannot hold the publish concurrency group --- .github/workflows/publish.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef43781..5f4bddf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -175,12 +175,19 @@ jobs: fi npm publish "${{ steps.pack.outputs.file }}" --access public --provenance --tag "${{ steps.disttag.outputs.tag }}" + # npm now accepts a publish before the version is visible ("Your package is + # being processed and may take a few minutes to become available"). + # 1.0.0-rc.4 took nine and a half minutes, and a one-minute wait failed a + # release that had published correctly, skipping the GitHub release. The + # polls total fifteen minutes; the step timeout bounds npm's own retries + # on top of them, so a stalled registry cannot hold the publish group. - name: Confirm the registry has the bytes we tested + timeout-minutes: 20 run: | VERSION="${{ steps.version.outputs.version }}" EXPECTED="${{ steps.pack.outputs.integrity }}" - for attempt in 1 2 3 4 5 6; do + for attempt in $(seq 1 90); do PUBLISHED="$(npm view "copytree@$VERSION" dist.integrity 2>/dev/null || true)" if [ -n "$PUBLISHED" ]; then # Existence is not enough. This is the assertion the whole @@ -193,7 +200,7 @@ jobs: echo "Registry reports $VERSION with matching integrity" exit 0 fi - echo "Not visible yet; retrying in 10s ($attempt/6)" + echo "Not visible yet; retrying in 10s ($attempt/90)" sleep 10 done echo "::error::copytree@$VERSION is not on the registry after publish"