From 1f1c66e59a19ea9ad4fd486c362520f80264a0ce Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sat, 18 Apr 2026 17:57:27 -0700 Subject: [PATCH] ci(release): retry electron install/publish on transient CDN failures (#809) Wrap the dependency install and release-artifact publish steps with nick-fields/retry@v3 so GitHub CDN 504s don't require a manual re-run of the release workflow. --- .github/workflows/release.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d010495be1..64de5cbed45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,8 +102,17 @@ jobs: with: run_install: false + # Why: pnpm install triggers electron's postinstall, which downloads the + # Electron binary from GitHub release assets. GitHub's download CDN + # occasionally returns 504s that fail the whole release. Retry on + # failure so transient network errors don't require a manual re-run. - name: Install dependencies - run: pnpm install --frozen-lockfile + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_wait_seconds: 30 + command: pnpm install --frozen-lockfile - name: Verify macOS signing environment if: matrix.platform == 'mac' @@ -125,9 +134,20 @@ jobs: # be signed with an Apple cert whose chain Windows cannot validate, # breaking the auto-updater with "certificate chain could not be built # to a trusted root authority" (issue #631). + # + # Why retry: electron-builder downloads NSIS/winCodeSign/squirrel + # binaries and the Electron runtime from GitHub release assets during + # publish. GitHub's download CDN occasionally returns 504s that fail + # the whole release. Retry on failure so transient network errors + # don't require a manual re-run. - name: Publish release artifacts (macOS) if: matrix.platform == 'mac' - run: ${{ matrix.release_command }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 45 + max_attempts: 3 + retry_wait_seconds: 30 + command: ${{ matrix.release_command }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} CSC_LINK: ${{ secrets.MAC_CERTS }} @@ -138,7 +158,12 @@ jobs: - name: Publish release artifacts if: matrix.platform != 'mac' - run: ${{ matrix.release_command }} + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + retry_wait_seconds: 30 + command: ${{ matrix.release_command }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}