From 6d585e821ed4aa386da3033dde1b1ca5adc7d10b Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:30:52 -0700 Subject: [PATCH] ci: cache electron + electron-builder tool downloads on release (#1110) electron-builder fetches the Electron binary and its platform tools (notarytool, winCodeSign, nsis, squirrel, AppImage) on every run. Cache those per-platform so repeat releases skip the re-download. Saves ~30-90s per job, including the macOS long pole. Key includes pnpm-lock.yaml so a bump to electron/electron-builder invalidates stale cached binaries; restore-keys falls back to the latest per-platform cache in between lockfile changes. Co-authored-by: Orca --- .github/workflows/release.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb58505e7..8e6179de5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,12 +86,21 @@ jobs: - os: macos-15 platform: mac release_command: ORCA_MAC_RELEASE=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish always + eb_cache_path: | + ~/Library/Caches/electron + ~/Library/Caches/electron-builder - os: windows-latest platform: win release_command: pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish always + eb_cache_path: | + ~\AppData\Local\electron\Cache + ~\AppData\Local\electron-builder\Cache - os: ubuntu-latest platform: linux release_command: pnpm exec electron-builder --config config/electron-builder.config.cjs --linux --publish always + eb_cache_path: | + ~/.cache/electron + ~/.cache/electron-builder runs-on: ${{ matrix.os }} @@ -116,6 +125,16 @@ jobs: node-version-file: .nvmrc cache: pnpm + # Cache the Electron binary + electron-builder tool downloads (notarytool, + # winCodeSign, nsis, squirrel, AppImage). Saves ~30-90s per job, incl. mac. + - name: Cache electron-builder downloads + uses: actions/cache@v4 + with: + path: ${{ matrix.eb_cache_path }} + key: electron-builder-${{ matrix.platform }}-${{ hashFiles('pnpm-lock.yaml') }} + restore-keys: | + electron-builder-${{ matrix.platform }}- + # 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