mirror of
https://github.com/armbian/imager.git
synced 2026-01-06 12:31:28 -08:00
fix: notarize only DMG file instead of .app bundle
This commit is contained in:
27
.github/workflows/build-artifacts.yml
vendored
27
.github/workflows/build-artifacts.yml
vendored
@@ -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
|
||||
|
||||
27
.github/workflows/build.yml
vendored
27
.github/workflows/build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user