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