Commit 693ec4d
committed
ci: end-to-end macOS code signing + notarization
Add the full signing infrastructure for macOS release binaries,
both for local development and CI. This includes the bundle
metadata, hardened-runtime entitlements, an updated sign script
that handles both architectures, a CI job that imports a P12
cert into a temporary keychain and signs/notarizes, and a gh
script to set the GitHub secrets.
What's added:
1. rel/Info.plist (new)
- Bundle metadata: CFBundleIdentifier, CFBundleName,
CFBundleShortVersionString, CFBundleVersion,
LSMinimumSystemVersion, LSUIElement, etc.
- Apple's notary service accepts single-binary notarization
without an Info.plist, but providing one is best practice
and lets us wrap in a .app bundle later without rewriting.
2. bin/ado.entitlements (new)
- Hardened-runtime entitlements required for BEAM:
* com.apple.security.cs.allow-jit (BEAM JIT, MAP_JIT)
* com.apple.security.cs.allow-unsigned-executable-memory
(BEAM loadable modules)
* com.apple.security.cs.disable-library-validation
(NIFs / dynamic shared object loading)
- Sandbox entitlements are intentionally NOT requested — this
is a CLI tool, not a sandboxed app.
3. bin/sign.sh (rewritten)
- Now signs BOTH macOS targets (aarch64 + x86_64), not just one
- Uses the new --entitlements flag
- Uses --options runtime --timestamp for hardened runtime
- Validates the signing identity is actually in the keychain
(catches typos early)
- Adds --skip-notarize mode for fast local iteration
- Reports spctl --assess at the end for each signed binary
- Falls back to legacy 'ado_macos' / 'ado_macos_x86' filenames
for older release artifacts
4. justfile (updated)
- release-macos: comment updated to mention both variants
- sign-macos: re-sign an existing build without rebuilding
- sign-macos-fast: sign only, skip notarization
- verify-macos: run codesign --verify + spctl --assess +
stapler validate on every macOS binary in burrito_out/
5. .github/workflows/ci.yml (updated)
- Added 'sign: true|false' to each matrix entry (true for
the 2 macOS jobs, false for the 2 Linux jobs)
- New conditional steps that run only when sign: true:
a. Import code-signing certificate
- Creates a temporary keychain in $RUNNER_TEMP
- Base64-decodes MACOS_CERT_P12_BASE64 into a .p12 file
- Imports it with the MACOS_CERT_P12_PASSWORD
- Sets the keychain as the default search list
- Sets the keychain partition list (apple-tool:, apple:)
b. Sign macOS binary
- codesign --force --options runtime --timestamp
--entitlements bin/ado.entitlements
--sign $MACOS_SIGN_IDENTITY
--keychain $MACOS_KEYCHAIN_PATH
c. Notarize macOS binary
- xcrun notarytool submit with --keychain-profile
- xcrun stapler staple + validate
- spctl --assess as final Gatekeeper check
d. Clean up keychain (always-runs, even on failure)
- If any of the MACOS_* secrets are missing, the step
emits a ::warning:: and skips gracefully (so PR builds
from forks / untrusted contributors still succeed)
6. SIGNING.md (rewritten)
- Documents the .p12 export procedure
- Documents the GitHub Secrets that need to be set
- Documents the new justfile recipes
- Documents the file layout (sign.sh, entitlements, Info.plist)
- Step-by-step CI verification procedure
7. bin/setup-gh-secrets.sh (new)
- Interactive script that uses 'gh secret set' to push the
four MACOS_* secrets to the repo
- Falls back to env vars if you set them in advance
- Prints the available Developer ID identities from your
keychain so you can copy/paste the right value
- Prints the commands to set up the notarytool profile
8. README.md (updated)
- File tree now lists rel/Info.plist, bin/ado.entitlements,
and bin/sign.sh
Verified locally:
- actionlint clean
- YAML parses
- mix ci green (compile + format + credo + xref + dialyzer + tests)
- 162 tests pass
- 'just verify-macos' correctly identifies the unsigned state
of the existing burrito_out/ binaries (expected) and reports
the right failures1 parent 55a73d0 commit 693ec4d
8 files changed
Lines changed: 691 additions & 103 deletions
File tree
- .github/workflows
- bin
- rel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| 218 | + | |
216 | 219 | | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
342 | 346 | | |
343 | 347 | | |
344 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
345 | 450 | | |
346 | 451 | | |
347 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
25 | 48 | | |
26 | | - | |
| 49 | + | |
27 | 50 | | |
28 | 51 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
34 | 61 | | |
35 | 62 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
55 | 112 | | |
56 | 113 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
61 | 118 | | |
62 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
63 | 135 | | |
64 | 136 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
68 | 145 | | |
69 | 146 | | |
70 | 147 | | |
71 | 148 | | |
72 | 149 | | |
| 150 | + | |
73 | 151 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments