From 5f755a7e1c1d06ec093e515d651f8dc6bdd407b9 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Tue, 24 Feb 2026 09:08:32 +0000 Subject: [PATCH] fix(ci): retry workspace version bump on macos --- .github/workflows/build-and-upload.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 03ddefd0..f5e82e34 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -61,7 +61,21 @@ jobs: - name: Set workspace versions if: ${{ inputs.set_versions && inputs.version != '' }} - run: npm version ${VERSION} --workspaces --include-workspace-root --no-git-tag-version --allow-same-version + shell: bash + env: + NPM_CONFIG_FETCH_RETRIES: 5 + NPM_CONFIG_FETCH_RETRY_MINTIMEOUT: 20000 + NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT: 120000 + run: | + set -euo pipefail + for attempt in 1 2 3; do + if npm version "${VERSION}" --workspaces --include-workspace-root --no-git-tag-version --allow-same-version; then + exit 0 + fi + echo "npm version failed (attempt $attempt/3); retrying..." >&2 + sleep $((attempt * 10)) + done + exit 1 - name: Install dependencies run: npm ci --workspaces --include=optional