new release script
This commit is contained in:
@@ -76,12 +76,17 @@ APP_PATH="$EXPORT_DIR/$APP_NAME.app"
|
||||
echo '==> Checking application signature and hardened runtime...'
|
||||
codesign --verify --deep --strict --verbose=2 "$APP_PATH"
|
||||
codesign -dv --verbose=4 "$APP_PATH" 2>&1 | grep -E 'Identifier=|Authority=|TeamIdentifier=|Runtime Version=|flags=' || true
|
||||
ACTUAL_TEAM="$(codesign -dv --verbose=4 "$APP_PATH" 2>&1 | sed -n 's/^TeamIdentifier=//p' | head -1)"
|
||||
# codesign -d prints details to stderr and may return a nonzero status even
|
||||
# when the signature is valid. Under `set -o pipefail`, piping it to grep
|
||||
# can therefore reject a correctly signed app. Capture once and inspect.
|
||||
SIGNATURE_INFO="$(codesign -dv --verbose=4 "$APP_PATH" 2>&1 || true)"
|
||||
ACTUAL_TEAM="$(printf '%s\n' "$SIGNATURE_INFO" | sed -n 's/^TeamIdentifier=//p' | head -n 1)"
|
||||
[[ "$ACTUAL_TEAM" == "$TEAM_ID" ]] || { echo "ERROR: Unexpected signing team: $ACTUAL_TEAM" >&2; exit 1; }
|
||||
codesign -dv --verbose=4 "$APP_PATH" 2>&1 | grep -q 'runtime' || {
|
||||
if ! grep -Eq 'flags=0x[[:xdigit:]]+\(runtime\)' <<< "$SIGNATURE_INFO"; then
|
||||
echo 'ERROR: App is not signed with the hardened runtime required for notarization.' >&2
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
echo '==> Hardened runtime verified.'
|
||||
|
||||
echo '==> Notarizing application...'
|
||||
ditto -c -k --keepParent "$APP_PATH" "$APP_ZIP"
|
||||
Reference in New Issue
Block a user