Skip to content

Commit f51f6ac

Browse files
atompilotclaude
andcommitted
fix: add hardened runtime and notarization status check (v2.4.1)
- Add --options runtime to codesign (required for Apple notarization) - Capture notarytool output and fail explicitly if status != Accepted - Prevents stapler from running when notarization is rejected Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 44a45a3 commit f51f6ac

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

macos/build.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ fi
122122

123123
# ─── Code sign ───
124124
echo "==> Code signing (identity: $SIGN_IDENTITY) …"
125-
codesign --force --deep --sign "$SIGN_IDENTITY" "$APP_DIR"
125+
# --options runtime enables Hardened Runtime, required for notarization
126+
codesign --force --deep --sign "$SIGN_IDENTITY" --options runtime "$APP_DIR"
126127

127128
# ─── Notarize (optional) ───
128129
if $DO_NOTARIZE; then
@@ -131,13 +132,19 @@ if $DO_NOTARIZE; then
131132
ditto -c -k --keepParent "$APP_DIR" "$ZIP_PATH"
132133
echo "==> Submitting for notarization …"
133134
if [ -n "${NOTARIZE_APPLE_ID:-}" ]; then
134-
xcrun notarytool submit "$ZIP_PATH" \
135+
NOTARIZE_OUTPUT=$(xcrun notarytool submit "$ZIP_PATH" \
135136
--apple-id "$NOTARIZE_APPLE_ID" \
136137
--password "$NOTARIZE_APPLE_ID_PASSWORD" \
137138
--team-id "$NOTARIZE_TEAM_ID" \
138-
--wait
139+
--wait 2>&1)
139140
else
140-
xcrun notarytool submit "$ZIP_PATH" --keychain-profile "notarytool" --wait
141+
NOTARIZE_OUTPUT=$(xcrun notarytool submit "$ZIP_PATH" \
142+
--keychain-profile "notarytool" --wait 2>&1)
143+
fi
144+
echo "$NOTARIZE_OUTPUT"
145+
if ! echo "$NOTARIZE_OUTPUT" | grep -q "status: Accepted"; then
146+
echo "Error: Notarization failed (not Accepted)" >&2
147+
exit 1
141148
fi
142149
echo "==> Stapling …"
143150
xcrun stapler staple "$APP_DIR"

0 commit comments

Comments
 (0)