Files
sized/scripts/notarize-macos.sh
T
gamertan e0707447ad
Sized Linux checks / Linux AMD64 / Rust 1.88.0 (pull_request) Successful in 4m54s
Sized Linux checks / Linux AMD64 / Rust 1.88.0 (push) Successful in 4m57s
Adopt pinned public core snapshot and prepare Sized 2.0.0
2026-10-10 13:11:02 -04:00

19 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
[[ $# == 2 ]] || { echo 'Usage: scripts/notarize-macos.sh PACKAGE_DIRECTORY NEW_DMG_PATH' >&2; exit 2; }
: "${SIZED_SIGN_IDENTITY:?Set a Developer ID Application identity.}"
package=$1
dmg=$2
[[ ! -e $dmg && ! -L $dmg ]] || { echo 'Refusing existing DMG.' >&2; exit 1; }
codesign --force --sign "$SIZED_SIGN_IDENTITY" --identifier com.gamertan.sized --options runtime --timestamp "$package/sized"
codesign --verify --strict --verbose=2 "$package/sized"
printf '\nMac distribution: Developer ID signed; see the notarized, stapled DMG.\n' >> "$package/BUILD-INFO.txt"
hdiutil create -quiet -volname 'Sized 2.0.0' -srcfolder "$package" -format UDZO "$dmg"
codesign --sign "$SIZED_SIGN_IDENTITY" --timestamp "$dmg"
xcrun notarytool submit "$dmg" --keychain-profile "${SIZED_NOTARY_PROFILE:-sizequeen-notary}" --wait --output-format json > "$dmg.notarization.json"
test "$(plutil -extract status raw "$dmg.notarization.json")" = Accepted
xcrun stapler staple "$dmg"
xcrun stapler validate "$dmg"
spctl --assess --type open --context context:primary-signature --verbose=2 "$dmg"
echo 'Signed, notarized and stapled disk image verified.'