From c48d2837f1573074580f1b9d68039634d83b5089 Mon Sep 17 00:00:00 2001 From: digua Date: Sat, 19 Sep 2026 09:07:44 +0800 Subject: [PATCH] fix(release): wait for npm package availability Wait for newly published CLI versions to become visible before building Docker images. Bound registry probes and the overall wait so npm outages cannot stall release jobs for hours. --- .github/workflows/release.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1ef6165..6a8a4f47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -565,6 +565,26 @@ jobs: packages: write steps: + - name: Wait for npm package availability + timeout-minutes: 5 + shell: bash + env: + CHATLAB_VERSION: ${{ needs.prepare_release.outputs.version }} + run: | + for attempt in {1..30}; do + published_version="$(npm view "chatlab-cli@${CHATLAB_VERSION}" version --registry=https://registry.npmjs.org --prefer-online --fetch-timeout=10000 --fetch-retries=0 2>/dev/null || true)" + if [ "$published_version" = "$CHATLAB_VERSION" ]; then + echo "chatlab-cli@${CHATLAB_VERSION} is available on npm" + exit 0 + fi + + echo "Waiting for chatlab-cli@${CHATLAB_VERSION} to become available on npm (${attempt}/30)" + sleep 10 + done + + echo "::error::chatlab-cli@${CHATLAB_VERSION} was not available on npm after 5 minutes" + exit 1 + - name: Checkout image definition uses: actions/checkout@v5