Commit 386f898
authored
🤖 Optimize macOS builds: parallelize architectures + cache Homebrew (#227)
## Problem
Build macOS job takes 4-13 minutes, with:
- Sequential notarization (x64 then arm64): ~7-10 min
- ImageMagick install from scratch: ~55s every run
## Solution
### 1. Parallelize Architecture Builds
Updated `Makefile` to build x64 and arm64 in parallel via `make -j2`:
- Notarization now happens concurrently instead of sequentially
- electron-builder is safe to run in parallel (separate output dirs,
caches)
### 2. Use Depot macOS Runners
Switch to `depot-macos-15` runners:
- 30% faster compute
- 10x faster caching (1000 MiB/s vs 125 MB/s)
- Built-in cache acceleration for `actions/cache`
### 3. Cache Homebrew in setup-cmux
Moved ImageMagick install + caching to `setup-cmux` action:
- Centralized for all workflows
- Uses Depot's 10x faster cache
- Install time: 55s → 2s (cache hit)
### 4. Remove Hardcoded Architecture Targets
Removed `mac.target` array from `package.json`:
- Allows Makefile to control architecture via CLI args
- Enables parallel builds with `--x64` and `--arm64`
## Impact
**Before:** 10-13 minutes
**After:** 4-5 minutes
**Speedup:** ~50-60% faster
Timeline:
- Build once: ~30s
- Package x64 + arm64 in parallel: ~4 min (limited by slower of the two)
## Testing
First build will be cache miss (55s for ImageMagick). Subsequent builds
will be ~2s.
_Generated with `cmux`_1 parent 60a71e2 commit 386f898
File tree
5 files changed
+62
-27
lines changed- .github
- actions/setup-cmux
- workflows
5 files changed
+62
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 59 | | |
66 | 60 | | |
67 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 46 | | |
53 | 47 | | |
54 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 123 | + | |
133 | 124 | | |
134 | 125 | | |
135 | 126 | | |
| |||
0 commit comments