Skip to content

Commit 0cdb90e

Browse files
committed
ci: improve macos notarization diagnostics
1 parent 6e8445c commit 0cdb90e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/build_and_release_all.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ jobs:
270270
echo "Signing app with identity: $CODESIGN_IDENTITY"
271271
codesign --keychain "$KEYCHAIN_PATH" \
272272
--deep --force --verify --verbose \
273+
--options runtime \
274+
--timestamp \
273275
--sign "${CODESIGN_IDENTITY}" "${APP_DIR}"
274276
codesign --verify --verbose=4 "${APP_DIR}"
275277
spctl --assess --type execute --verbose "${APP_DIR}" || true
@@ -330,11 +332,26 @@ jobs:
330332
exit 0
331333
fi
332334
333-
xcrun notarytool submit "${DMG_NAME}" \
335+
SUBMISSION_OUTPUT="$(xcrun notarytool submit "${DMG_NAME}" \
334336
--apple-id "${APPLE_ID}" \
335337
--password "${APPLE_APP_SPECIFIC_PASSWORD}" \
336338
--team-id "${APPLE_TEAM_ID}" \
337-
--wait
339+
--wait \
340+
--output-format json)"
341+
342+
echo "${SUBMISSION_OUTPUT}"
343+
344+
SUBMISSION_ID="$(echo "${SUBMISSION_OUTPUT}" | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')"
345+
SUBMISSION_STATUS="$(echo "${SUBMISSION_OUTPUT}" | python3 -c 'import json,sys; print(json.load(sys.stdin)["status"])')"
346+
347+
if [[ "${SUBMISSION_STATUS}" != "Accepted" ]]; then
348+
echo "Notarization failed with status: ${SUBMISSION_STATUS}"
349+
xcrun notarytool log "${SUBMISSION_ID}" \
350+
--apple-id "${APPLE_ID}" \
351+
--password "${APPLE_APP_SPECIFIC_PASSWORD}" \
352+
--team-id "${APPLE_TEAM_ID}" || true
353+
exit 1
354+
fi
338355
339356
xcrun stapler staple "${DMG_NAME}"
340357
xcrun stapler validate "${DMG_NAME}"

0 commit comments

Comments
 (0)