From 0bce42b3aae104ed39e8c27761a963913652368b Mon Sep 17 00:00:00 2001 From: Jonathan Spangler Date: Mon, 26 Oct 2026 13:32:59 -0700 Subject: [PATCH] fix(desktop): sign the release DMG before notarizing it The first desktop release dry run (run 40395709311) built, signed, notarized and stapled the app, and notarized and stapled the DMG, but Gatekeeper rejected the DMG: `spctl --assess --type open` reported `source=no usable signature`. electron-builder leaves the DMG unsigned. Sign the DMG with the same Developer ID (by fingerprint, from the temporary keychain) before submitting it to notarization, and verify the DMG's signature, team and `Notarized Developer ID` assessment. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-desktop.yml | 11 +++++++++-- changelog.d/desktop-release-sign-dmg.md | 5 +++++ docs/operations/desktop-release.md | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 changelog.d/desktop-release-sign-dmg.md diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index a3bcf73d1e..e3e2f9176e 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -129,7 +129,7 @@ jobs: npm ci npm run dist - - name: Notarize and staple the DMG + - name: Sign, notarize and staple the DMG working-directory: desktop-app/release env: APPLE_ID: ${{ secrets.APPLE_ID }} @@ -137,6 +137,9 @@ jobs: run: | set -euo pipefail DMG="Darkbloom-$VERSION-arm64.dmg" + # electron-builder leaves the DMG unsigned; Gatekeeper wants the container + # signed by the same Developer ID before it's notarized. + codesign --sign "$CSC_NAME" --keychain "$KEYCHAIN_PATH" --timestamp "$DMG" xcrun notarytool submit "$DMG" --apple-id "$APPLE_ID" --password "$APPLE_APP_PASSWORD" \ --team-id "$APPLE_TEAM_ID" --wait --output-format json > "$RUNNER_TEMP/notary.json" status=$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["status"])' "$RUNNER_TEMP/notary.json") @@ -166,7 +169,11 @@ jobs: grep -q "source=Notarized Developer ID" "$RUNNER_TEMP/spctl.txt" xcrun stapler validate "$APP" xcrun stapler validate "$DMG" - spctl --assess --type open --context context:primary-signature --verbose=2 "$DMG" + codesign --verify --verbose=2 "$DMG" + team=$(codesign -dv "$DMG" 2>&1 | sed -n 's/^TeamIdentifier=//p') + [ "$team" = "$APPLE_TEAM_ID" ] || { echo "::error::DMG signed by team $team, expected $APPLE_TEAM_ID"; exit 1; } + spctl --assess --type open --context context:primary-signature --verbose=2 "$DMG" 2>&1 | tee "$RUNNER_TEMP/spctl-dmg.txt" + grep -q "source=Notarized Developer ID" "$RUNNER_TEMP/spctl-dmg.txt" hdiutil verify "$DMG" bash -n "$APP/Contents/Resources/bootstrap/install-runtime.sh" shasum -a 256 "$DMG" "$ZIP" > SHA256SUMS diff --git a/changelog.d/desktop-release-sign-dmg.md b/changelog.d/desktop-release-sign-dmg.md new file mode 100644 index 0000000000..18ea8699cd --- /dev/null +++ b/changelog.d/desktop-release-sign-dmg.md @@ -0,0 +1,5 @@ +### Desktop release signs the DMG + +The desktop release workflow now signs the DMG with the Eigen Labs Developer ID +before notarizing it. The first dry run built, signed and notarized the app, but +Gatekeeper rejected the unsigned DMG (`source=no usable signature`). diff --git a/docs/operations/desktop-release.md b/docs/operations/desktop-release.md index 774a4df991..0900720bb3 100644 --- a/docs/operations/desktop-release.md +++ b/docs/operations/desktop-release.md @@ -1,6 +1,6 @@ # Release The macOS Desktop App -> Last updated: 2026-10-23 +> Last updated: 2026-10-26 Build, sign, notarize and publish the Darkbloom desktop app (`desktop-app/`) as a GitHub Release. The workflow is `.github/workflows/release-desktop.yml`. It signs @@ -54,7 +54,8 @@ Before anything is published: name) with the hardened runtime, has bundle ID `io.darkbloom.desktop` and the package version, and is notarized and stapled. `spctl` reports `Notarized Developer ID`. -- The DMG is notarized, stapled and passes `hdiutil verify`. +- The DMG is signed by the same team, notarized and stapled, `spctl` reports + `Notarized Developer ID` for it, and it passes `hdiutil verify`. - The bundled CLI installer (`Contents/Resources/bootstrap/install-runtime.sh`) is present and parses.