From 32e71b038682b5d7805e35650ab851a86ca1f7ac Mon Sep 17 00:00:00 2001 From: tooomm Date: Tue, 24 Jun 2025 01:58:28 +0200 Subject: [PATCH] fetch logs on error (#6003) --- .ci/sign_macos.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.ci/sign_macos.sh b/.ci/sign_macos.sh index ad64cde17..800311829 100755 --- a/.ci/sign_macos.sh +++ b/.ci/sign_macos.sh @@ -56,7 +56,22 @@ if [[ -n "$MACOS_NOTARIZATION_APPLE_ID" ]]; then # This typically takes a few seconds inside a CI environment, but it might take more depending on the App # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if # you're curious - xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait + # Submit for notarization and capture output + NOTARY_OUTPUT=$(xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait --output-format json) + + # Parse the submission ID from the JSON output + SUBMISSION_ID=$(echo "$NOTARY_OUTPUT" | jq -r '.id') + + # Parse the status field in the JSON + STATUS=$(echo "$NOTARY_OUTPUT" | jq -r '.status') + + if [[ "$STATUS" != "Accepted" ]]; then + echo "Notarization failed (status: $STATUS). Fetching detailed log..." + # Fetch and print the notarization log + xcrun notarytool log "$SUBMISSION_ID" --keychain-profile "notarytool-profile" + exit 1 + fi + else echo "No Apple ID configured." fi