From 443eb16e6708e28a56e82be9a5b206ebcba53919 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 11 Mar 2026 11:09:41 +0700 Subject: [PATCH] Notarize macOS DMG to fix quarantine on bundled binaries Tauri notarizes the .app but not the .dmg container. When users download the DMG from GitHub Releases, macOS quarantines everything and Gatekeeper doesn't clear quarantine on embedded helper binaries (like the bundled Node runtime), causing SIGTRAP on first launch. Add a post-build step that signs, notarizes, and staples the DMG, then re-uploads it to the release. --- .github/workflows/desktop-release.yml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml index cdb8bbd54..c77c2190e 100644 --- a/.github/workflows/desktop-release.yml +++ b/.github/workflows/desktop-release.yml @@ -172,6 +172,7 @@ jobs: - name: Build and publish macOS Tauri release if: env.IS_SMOKE_TAG != 'true' + id: tauri_build uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -192,6 +193,44 @@ jobs: prerelease: false args: --target ${{ matrix.rust_target }} + - name: Notarize and re-upload DMG + if: env.IS_SMOKE_TAG != 'true' + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + set -euo pipefail + artifacts='${{ steps.tauri_build.outputs.artifactPaths }}' + dmg_path=$(echo "$artifacts" | jq -r '.[] | select(endswith(".dmg"))') + if [ -z "$dmg_path" ]; then + echo "::error::No DMG found in tauri build artifacts" + exit 1 + fi + echo "DMG: $dmg_path" + + echo "Signing DMG..." + codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp "$dmg_path" + + echo "Submitting DMG for notarization..." + xcrun notarytool submit "$dmg_path" \ + --apple-id "$APPLE_ID" \ + --password "$APPLE_PASSWORD" \ + --team-id "$APPLE_TEAM_ID" \ + --wait + + echo "Stapling notarization ticket..." + xcrun stapler staple "$dmg_path" + + echo "Verifying..." + spctl --assess --type install --verbose "$dmg_path" + + echo "Replacing release asset with notarized DMG..." + gh release upload "$RELEASE_TAG" "$dmg_path" --repo "${{ github.repository }}" --clobber + - name: Build macOS app (smoke only) if: env.IS_SMOKE_TAG == 'true' run: npm run tauri --workspace=@getpaseo/desktop build -- --target ${{ matrix.rust_target }} --no-bundle