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.