Files
EZ4Connect/scripts/macos-notarize-dmg.sh
2026-02-10 16:58:31 +08:00

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"