@@ -237,29 +237,13 @@ jobs:
237237 run: pnpm exec electron-builder --mac dmg zip --publish never
238238
239239 # electron-builder notarizes and staples the .app but never the disk
240- # image around it. A quarantined, unnotarized DMG is what Gatekeeper
241- # reports as "damaged" on some macOS builds , so give the image its own
242- # ticket and staple it. The API key is preferred; the Apple ID +
243- # app-specific password pair is the fallback, mirroring electron-builder .
240+ # image around it; a quarantined, unnotarized DMG is what Gatekeeper
241+ # reports as "damaged". Stapling changes the DMG bytes , so the same
242+ # script also rewrites its latest-mac.yml entry and drops the stale
243+ # blockmap, keeping the update manifest verification below honest .
244244 - name: Notarize and staple macOS DMG
245- shell: bash
246- run: |
247- set -euo pipefail
248- dmg_path="$(find apps/desktop/dist -maxdepth 1 -type f -name '*.dmg' -print -quit)"
249- if [ -z "$dmg_path" ]; then
250- echo 'macOS DMG not found' >&2
251- exit 1
252- fi
253- if [ -n "${APPLE_API_KEY:-}" ]; then
254- auth=(--key "$APPLE_API_KEY" --key-id "$APPLE_API_KEY_ID" --issuer "$APPLE_API_ISSUER")
255- elif [ -n "${APPLE_ID:-}" ]; then
256- auth=(--apple-id "$APPLE_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --team-id "$APPLE_TEAM_ID")
257- else
258- echo 'No notarization credentials configured; the DMG cannot be notarized.' >&2
259- exit 1
260- fi
261- xcrun notarytool submit "$dmg_path" "${auth[@]}" --wait --timeout 30m
262- xcrun stapler staple "$dmg_path"
245+ working-directory: apps/desktop
246+ run: node --import tsx scripts/finalize-mac-artifacts.ts dist
263247
264248 - name: Verify macOS update artifacts
265249 shell: bash
0 commit comments