Skip to content

Commit 418239c

Browse files
jared-duvalclaude
andcommitted
Improve signing and add notarization log on failure
- Sign all executable files in MacOS folder - Verify signing before notarization - Fetch and display notarization log if rejected Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7c84bbe commit 418239c

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ jobs:
5858
xattr -cr "Budget Justification Generator.app"
5959
# Sign all .so and .dylib files
6060
find "Budget Justification Generator.app" -type f \( -name "*.so" -o -name "*.dylib" \) -exec codesign --force --options runtime --sign "Developer ID Application: Jared Scott Duval (FH7G4JHQUE)" {} \;
61-
# Sign bundled Pandoc executables (find them wherever they are)
62-
find "Budget Justification Generator.app" -type f -name "pandoc*" ! -name "*.py" -exec codesign --force --options runtime --sign "Developer ID Application: Jared Scott Duval (FH7G4JHQUE)" {} \;
63-
# Sign main executable
61+
# Sign ALL executable files in MacOS folder (including Pandoc, Python, etc.)
62+
find "Budget Justification Generator.app/Contents/MacOS" -type f -perm +111 -exec codesign --force --options runtime --sign "Developer ID Application: Jared Scott Duval (FH7G4JHQUE)" {} \;
63+
# Sign main executable explicitly
6464
codesign --force --options runtime --sign "Developer ID Application: Jared Scott Duval (FH7G4JHQUE)" "Budget Justification Generator.app/Contents/MacOS/Budget Justification Generator"
6565
# Sign app bundle
6666
codesign --force --options runtime --sign "Developer ID Application: Jared Scott Duval (FH7G4JHQUE)" "Budget Justification Generator.app"
67+
# Verify signing
68+
codesign --verify --deep --strict --verbose=2 "Budget Justification Generator.app"
6769
6870
- name: Notarize app
6971
env:
@@ -79,11 +81,22 @@ jobs:
7981
printf '%s\n' "$APPLE_API_KEY" > ~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8
8082
chmod 600 ~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8
8183
# Submit for notarization
82-
xcrun notarytool submit "BudgetJustificationGenerator-macOS.zip" \
84+
SUBMIT_OUTPUT=$(xcrun notarytool submit "BudgetJustificationGenerator-macOS.zip" \
8385
--key ~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8 \
8486
--key-id "$APPLE_API_KEY_ID" \
8587
--issuer "$APPLE_API_ISSUER" \
86-
--wait
88+
--wait 2>&1) || true
89+
echo "$SUBMIT_OUTPUT"
90+
# Extract submission ID and get log if failed
91+
SUBMISSION_ID=$(echo "$SUBMIT_OUTPUT" | grep "id:" | head -1 | awk '{print $2}')
92+
if echo "$SUBMIT_OUTPUT" | grep -q "status: Invalid"; then
93+
echo "Notarization failed. Fetching log..."
94+
xcrun notarytool log "$SUBMISSION_ID" \
95+
--key ~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8 \
96+
--key-id "$APPLE_API_KEY_ID" \
97+
--issuer "$APPLE_API_ISSUER"
98+
exit 1
99+
fi
87100
# Staple
88101
xcrun stapler staple "Budget Justification Generator.app"
89102
# Recreate zip with stapled app

0 commit comments

Comments
 (0)