Skip to content

Commit 1d6ef7c

Browse files
beautyfreeclaude
andauthored
Fix macOS notarization: APPLE_API_ISSUER + drop redundant afterSign hook (#6)
The v0.2.0 retry run got further (linux OK, windows OK, macOS signing OK) but macOS notarization failed with: ⨯ Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set Two misconceptions in Phase 5: 1. The env var is `APPLE_API_ISSUER`, not `APPLE_API_KEY_ISSUER`. electron-builder rejects the `_KEY_` variant. Secret renamed out-of-band in the GitHub repo; workflow updated here. 2. Since electron-builder 26 notarizes natively whenever those env vars are present, our `afterSign: scripts/notarize.mjs` hook was redundant and actually fired after the built-in notarization had already failed. Drop the hook, drop `scripts/notarize.mjs`, drop `@electron/notarize` from devDependencies (electron-builder includes its own copy transitively). Docs + CLAUDE.md pick up the rename and the simplified flow. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9824de9 commit 1d6ef7c

7 files changed

Lines changed: 18 additions & 111 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ jobs:
142142
# via softprops below instead but the var being set also unlocks
143143
# electron-builder's release-draft verification.
144144
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145-
# macOS signing + notarization (renamed from ELECTROBUN_* in Phase 5).
145+
# macOS signing + notarization. Env-var names follow electron-builder's
146+
# conventions (NB: `APPLE_API_ISSUER`, not `APPLE_API_KEY_ISSUER` —
147+
# electron-builder rejects the "_KEY_" variant).
146148
CSC_NAME: ${{ secrets.CSC_NAME }}
147-
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
149+
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
148150
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
149151
run: bun run ${{ matrix.script }}
150152

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Skiller is a **cross-platform desktop app** (Electron) for installing, syncing,
2525
| `assets/icons/` | **Runtime icons**: `AppIcon.iconset/`, `app.icns`, `app.ico`, `app/icon-512.png` |
2626
| `assets/icons/Skiller.icon/` | **Source only** (Icon Composer): `scripts/build-app-icons.py` reads `Assets/Image.png` via `icon.json` |
2727
| `build-resources/` | `entitlements.mac.plist` for Hardened Runtime |
28-
| `scripts/` | `build-app-icons.py`, `normalize-skiller-icon-layer.py`, `repack-dmg.sh`, `notarize.mjs` |
28+
| `scripts/` | `build-app-icons.py`, `normalize-skiller-icon-layer.py`, `repack-dmg.sh` |
2929
| `docs/DEVELOPMENT.md` | Setup, HMR, signing, CI, DMG repack — **read before changing release/signing** |
3030
| `DESIGN.md` | UI tokens and product design notes |
3131

@@ -81,7 +81,7 @@ See `docs/DEVELOPMENT.md` for signing env vars and artifact locations.
8181
| `AGENTSKILLS_TRPC_PORT` | tRPC HTTP port (default `17888`; falls through to +48 on conflict) |
8282
| `AGENTSKILLS_DEVTOOLS` | Auto-open renderer DevTools on launch (dev only) |
8383
| `AGENTSKILLS_DISABLE_WINDOW_BLUR` | `1` → force vibrancy off on macOS even if settings say on |
84-
| `CSC_NAME`, `APPLE_API_KEY_*`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID` | macOS signing + notarization. See `docs/DEVELOPMENT.md`. |
84+
| `CSC_NAME`, `APPLE_API_KEY`, `APPLE_API_KEY_ID`, `APPLE_API_ISSUER`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID` | macOS signing + notarization. See `docs/DEVELOPMENT.md`. |
8585

8686
## Further reading
8787

bun.lock

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/DEVELOPMENT.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ macOS signing + notarization:
7676
- `MACOS_CERT_P12_PASSWORD` — password used to export the `.p12`
7777
- `MACOS_KEYCHAIN_PASSWORD` — arbitrary temp-keychain password (generate any string)
7878
- `CSC_NAME` — full identity string (e.g. `Developer ID Application: Your Name (XXXXXXXXXX)`)
79-
- `APPLE_API_KEY_ISSUER` — App Store Connect → Users and Access → Integrations → App Store Connect API → Issuer ID
79+
- `APPLE_API_ISSUER` — App Store Connect → Users and Access → Integrations → App Store Connect API → Issuer ID
8080
- `APPLE_API_KEY_ID` — 10-char Key ID
8181
- `APPLE_API_KEY_P8` — full contents of the `AuthKey_XXXXXXXXXX.p8` file (multi-line secret)
8282

@@ -109,7 +109,7 @@ Electron-builder reads these from `.env` or the shell when you run `bun run dist
109109
| --- | --- |
110110
| `CSC_NAME` | Full Developer ID identity string |
111111
| `APPLE_API_KEY_ID` | 10-char Key ID from App Store Connect |
112-
| `APPLE_API_KEY_ISSUER` | Issuer UUID |
112+
| `APPLE_API_ISSUER` | Issuer UUID |
113113
| `APPLE_API_KEY` | Absolute path to the `.p8` file (preferred for CI) |
114114
| — or Apple ID fallback — |
115115
| `APPLE_ID` | Developer Apple ID email |
@@ -119,7 +119,7 @@ Electron-builder reads these from `.env` or the shell when you run `bun run dist
119119
### Flow
120120

121121
1. `electron-vite build` — emits main + preload + renderer into `out/`.
122-
2. `electron-builder --mac` — creates a signed `.app` in `artifacts/mac-arm64/` and runs `scripts/notarize.mjs` as `afterSign` (notarizes + staples the app bundle).
122+
2. `electron-builder --mac` — creates a signed `.app` in `artifacts/mac-arm64/`, then notarizes + staples it using the API-key env vars (handled natively by electron-builder 26+; no custom afterSign hook needed).
123123
3. `scripts/repack-dmg.sh` — wraps the signed app in a styled drag-to-Applications DMG, re-signs the DMG wrapper, notarizes + staples the DMG.
124124

125125
### Verify locally
@@ -143,7 +143,7 @@ Relevant config:
143143
Apple returns a JSON log listing unsigned binaries or missing secure timestamps when notarization fails. Common causes:
144144

145145
- A native addon (e.g. `better-sqlite3.node`) wasn't codesigned with `--timestamp`. `electron-builder` handles this automatically; if you add new native modules, `bunx electron-builder install-app-deps` on the target OS before dist.
146-
- Missing one of the three API-key vars. All three (`APPLE_API_KEY_ISSUER`, `APPLE_API_KEY_ID`, `APPLE_API_KEY`) must be present, and the `.p8` file must exist at the path in `APPLE_API_KEY`.
146+
- Missing one of the three API-key vars. All three (`APPLE_API_ISSUER`, `APPLE_API_KEY_ID`, `APPLE_API_KEY`) must be present, and the `.p8` file must exist at the path in `APPLE_API_KEY`.
147147

148148
## Renderer DevTools / blank screen debugging
149149

electron-builder.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ extraResources:
2626
asarUnpack:
2727
- "**/*.node"
2828

29-
# After electron-builder signs the .app, we notarize and staple it ourselves
30-
# via the hook below.
31-
afterSign: scripts/notarize.mjs
29+
# Notarization: electron-builder 26+ handles it natively when the expected env
30+
# vars are present (APPLE_API_KEY, APPLE_API_KEY_ID, APPLE_API_ISSUER for the
31+
# API-key flow; APPLE_ID + APPLE_APP_SPECIFIC_PASSWORD + APPLE_TEAM_ID as
32+
# fallback). No afterSign hook needed — running our own notarize.mjs on top
33+
# would just re-submit the already-notarized bundle.
3234

3335
mac:
3436
category: public.app-category.developer-tools

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"devDependencies": {
6363
"@electron-toolkit/preload": "^3.0.2",
6464
"@electron-toolkit/utils": "^4.0.0",
65-
"@electron/notarize": "^3.1.1",
6665
"@tailwindcss/vite": "^4.2.1",
6766
"@trpc/react-query": "^11.0.0",
6867
"@types/better-sqlite3": "^7.6.13",

scripts/notarize.mjs

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)