#!/bin/bash # Usage: ./scripts/macos-notarize-dmg.sh "" 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"