fix: notarize only DMG file instead of .app bundle

This commit is contained in:
SuperKali
2025-12-31 17:30:48 +01:00
parent 840509ec0c
commit 4b9f5289f7
2 changed files with 12 additions and 42 deletions

View File

@@ -268,53 +268,38 @@ jobs:
ditto -c -k --sequesterRsrc --keepParent "$app" "$CARGO_TARGET_DIR/release/bundle/macos/${base}-${{ matrix.arch }}.app.zip"
done
- name: Notarize and staple .app and DMG
- name: Notarize and staple DMG
shell: bash
env:
CARGO_TARGET_DIR: src-tauri/target/${{ matrix.target }}
run: |
set -euo pipefail
# Find the .app bundle
APP_FILE=$(find "$CARGO_TARGET_DIR/release/bundle/macos/" -name "*.app" -type d | head -n 1)
# Find the DMG file
DMG_FILE=$(find "$CARGO_TARGET_DIR/release/bundle/dmg/" -name "*.dmg" -type f | head -n 1)
if [[ -z "$APP_FILE" ]]; then
echo "No .app bundle found"
exit 1
fi
if [[ -z "$DMG_FILE" ]]; then
echo "No DMG file found"
exit 1
fi
echo "Notarizing .app bundle: $APP_FILE"
echo "Notarizing DMG: $DMG_FILE"
echo "Notarizing: $DMG_FILE"
# Submit .app for notarization (primary artifact)
xcrun notarytool submit "$APP_FILE" \
# Submit DMG for notarization
xcrun notarytool submit "$DMG_FILE" \
--apple-id "$APPLE_ID" \
--password "$APPLE_ID_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait \
--output-format json
# Staple the notarization ticket to .app
xcrun stapler staple "$APP_FILE"
# Verify .app stapling
xcrun stapler validate -v "$APP_FILE"
# Staple the notarization ticket to DMG
xcrun stapler staple "$DMG_FILE"
# Verify DMG stapling
# Verify stapling
xcrun stapler validate -v "$DMG_FILE"
echo "Notarization completed successfully for both .app and DMG"
echo "Notarization completed successfully"
- name: Upload artifacts
uses: actions/upload-artifact@v4

View File

@@ -423,53 +423,38 @@ jobs:
mv "$sig" "$CARGO_TARGET_DIR/release/bundle/macos/${base}-${{ matrix.arch }}.tar.gz.sig"
done
- name: Notarize and staple .app and DMG
- name: Notarize and staple DMG
shell: bash
env:
CARGO_TARGET_DIR: src-tauri/target/${{ matrix.target }}
run: |
set -euo pipefail
# Find the .app bundle
APP_FILE=$(find "$CARGO_TARGET_DIR/release/bundle/macos/" -name "*.app" -type d | head -n 1)
# Find the DMG file
DMG_FILE=$(find "$CARGO_TARGET_DIR/release/bundle/dmg/" -name "*.dmg" -type f | head -n 1)
if [[ -z "$APP_FILE" ]]; then
echo "No .app bundle found"
exit 1
fi
if [[ -z "$DMG_FILE" ]]; then
echo "No DMG file found"
exit 1
fi
echo "Notarizing .app bundle: $APP_FILE"
echo "Notarizing DMG: $DMG_FILE"
echo "Notarizing: $DMG_FILE"
# Submit .app for notarization (primary artifact)
xcrun notarytool submit "$APP_FILE" \
# Submit DMG for notarization
xcrun notarytool submit "$DMG_FILE" \
--apple-id "$APPLE_ID" \
--password "$APPLE_ID_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait \
--output-format json
# Staple the notarization ticket to .app
xcrun stapler staple "$APP_FILE"
# Verify .app stapling
xcrun stapler validate -v "$APP_FILE"
# Staple the notarization ticket to DMG
xcrun stapler staple "$DMG_FILE"
# Verify DMG stapling
# Verify stapling
xcrun stapler validate -v "$DMG_FILE"
echo "Notarization completed successfully for both .app and DMG"
echo "Notarization completed successfully"
- name: Upload macOS artifacts to GitHub Release
uses: ncipollo/release-action@v1