Skip to content

Commit 350e9c1

Browse files
devsemihclaude
andcommitted
Add re-sign with timestamp and notarization log on failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f2f23f3 commit 350e9c1

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ jobs:
6161
CODE_SIGN_IDENTITY="Developer ID Application" \
6262
DEVELOPMENT_TEAM=${{ secrets.APPLE_TEAM_ID }}
6363
64+
- name: Verify signature
65+
run: |
66+
APP_PATH="build/Build/Products/Release/appjail.app"
67+
codesign -dvv "$APP_PATH"
68+
codesign --verify --deep --strict "$APP_PATH"
69+
6470
- name: Notarize
6571
env:
6672
APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -69,15 +75,31 @@ jobs:
6975
run: |
7076
APP_PATH="build/Build/Products/Release/appjail.app"
7177
78+
# Re-sign with hardened runtime + timestamp explicitly
79+
codesign --force --deep --options runtime --timestamp \
80+
--sign "Developer ID Application" "$APP_PATH"
81+
7282
# Create zip for notarization
7383
ditto -c -k --keepParent "$APP_PATH" appjail.zip
7484
75-
# Submit for notarization
76-
xcrun notarytool submit appjail.zip \
85+
# Submit for notarization and capture output
86+
SUBMIT_OUT=$(xcrun notarytool submit appjail.zip \
7787
--apple-id "$APPLE_ID" \
7888
--password "$APPLE_ID_PASSWORD" \
7989
--team-id "$APPLE_TEAM_ID" \
80-
--wait
90+
--wait 2>&1) || true
91+
echo "$SUBMIT_OUT"
92+
93+
# Extract submission ID and fetch log if failed
94+
SUB_ID=$(echo "$SUBMIT_OUT" | grep "id:" | head -1 | awk '{print $2}')
95+
if echo "$SUBMIT_OUT" | grep -q "Invalid"; then
96+
echo "--- Notarization Log ---"
97+
xcrun notarytool log "$SUB_ID" \
98+
--apple-id "$APPLE_ID" \
99+
--password "$APPLE_ID_PASSWORD" \
100+
--team-id "$APPLE_TEAM_ID"
101+
exit 1
102+
fi
81103
82104
# Staple the ticket
83105
xcrun stapler staple "$APP_PATH"

0 commit comments

Comments
 (0)