Skip to content

Commit 8125b40

Browse files
authored
🤖 ci: parallelize macOS PR builds by skipping signing setup (#834)
## Summary Two optimizations to speed up macOS CI builds for pull requests: 1. **Skip signing setup for PRs** - electron-builder skips code signing for PRs anyway, but the Makefile was forcing sequential builds when `CSC_LINK` was set. Now we skip the signing setup step entirely for PRs, allowing parallel x64/arm64 builds. 2. **Skip bun cache restore on node_modules hit** - The bun install cache (~470MB, ~104k files) only benefits `bun install` runs. When node_modules cache hits, we skip install entirely, so restoring the bun cache was wasting ~37s extracting unused files. ## Results | Step | Before | After | Saved | |------|--------|-------|-------| | setup-mux | 61s | 24s | **37s** | | Package for macOS | 331s | 168s | **163s** | | **Total** | **392s** | **192s** | **200s (51%)** | --- _Generated with `mux`_
1 parent b0aae84 commit 8125b40

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/actions/setup-mux/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ runs:
2323
${{ runner.os }}-${{ runner.arch }}-bun-${{ steps.bun-version.outputs.version }}-node-modules-
2424
2525
- name: Cache bun install cache
26+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
2627
id: cache-bun-install
2728
uses: actions/cache@v4
2829
with:

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ jobs:
1818

1919
- uses: ./.github/actions/setup-mux
2020

21+
# Skip signing setup for PRs - electron-builder skips signing anyway,
22+
# but setting CSC_LINK forces our Makefile to build sequentially.
23+
# Without CSC_LINK, x64 and arm64 build in parallel (~90s savings).
2124
- name: Setup code signing
25+
if: github.event_name != 'pull_request'
2226
run: ./scripts/setup-macos-signing.sh
2327
env:
2428
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
@@ -28,6 +32,7 @@ jobs:
2832
AC_APIKEY_ISSUER_ID: ${{ secrets.AC_APIKEY_ISSUER_ID }}
2933

3034
- name: Verify signing setup
35+
if: github.event_name != 'pull_request'
3136
run: |
3237
if [ -n "${CSC_LINK:-}" ]; then
3338
echo "✅ Code signing enabled"
@@ -39,8 +44,6 @@ jobs:
3944
4045
- name: Package for macOS
4146
run: make dist-mac
42-
env:
43-
CSC_FOR_PULL_REQUEST: ${{ github.event.pull_request.number == 234 }}
4447

4548
- name: Upload macOS DMG (x64)
4649
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)