From cc84f539a64ef97739ac44261c36a8e6c70275eb Mon Sep 17 00:00:00 2001 From: Jason Roy Date: Wed, 24 Jun 2026 19:19:04 -0700 Subject: [PATCH] ci: make publish verification tolerate npm registry propagation lag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Verify published" step ran `npm view` 5s after publishing and 404'd on registry lag, failing the job *after* a successful publish — which skipped the GitHub Release step (the v16.2.9 release had to be created by hand). Poll for the version (up to ~2 min) and never fail the job on a slow read; the publish step is authoritative. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bf55189..c2b9c22 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -109,10 +109,18 @@ jobs: echo "✅ Published @mrjasonroy/cache-components-cache-handler@$PACKAGE_VERSION" echo "📦 npm dist-tag: $DIST_TAG" - # Wait a moment for npm to propagate - sleep 5 - - npm view @mrjasonroy/cache-components-cache-handler@$PACKAGE_VERSION + # Poll until the new version is queryable; registry propagation can lag + # well past a few seconds. The publish step already succeeded, so a slow + # read must NOT fail the job (that would skip the GitHub Release step). + for i in $(seq 1 12); do + if npm view "@mrjasonroy/cache-components-cache-handler@$PACKAGE_VERSION" version >/dev/null 2>&1; then + echo "✅ Verified on npm (attempt $i)" + npm view "@mrjasonroy/cache-components-cache-handler@$PACKAGE_VERSION" + break + fi + echo "… not visible yet, retrying ($i/12)" + sleep 10 + done - name: Create GitHub Release env: