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 <help@stably.ai>
This commit is contained in:
Neil 2026-04-25 21:30:52 -07:00 committed by GitHub
parent 7b25a02d1c
commit 6d585e821e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -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