mirror of
https://github.com/chenx-dust/EZ4Connect.git
synced 2026-09-20 02:13:32 +08:00
25 lines
580 B
Bash
Executable File
25 lines
580 B
Bash
Executable File
#!/bin/bash
|
|
# Usage: ./scripts/macos-notarize-dmg.sh "<dmg_path>"
|
|
|
|
set -euo pipefail
|
|
|
|
DMG_PATH="${1:-}"
|
|
|
|
if [[ -z "${APPLE_ID:-}" || -z "${APPLE_APP_SPECIFIC_PASSWORD:-}" || -z "${APPLE_TEAM_ID:-}" ]]; then
|
|
echo "APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD and APPLE_TEAM_ID are required"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "$DMG_PATH" || ! -f "$DMG_PATH" ]]; then
|
|
echo "DMG not found: $DMG_PATH"
|
|
exit 1
|
|
fi
|
|
|
|
xcrun notarytool submit "$DMG_PATH" \
|
|
--apple-id "$APPLE_ID" \
|
|
--password "$APPLE_APP_SPECIFIC_PASSWORD" \
|
|
--team-id "$APPLE_TEAM_ID" \
|
|
--wait
|
|
|
|
xcrun stapler staple "$DMG_PATH"
|