From 9b3adf1c682afed6fc25220ba3fcc0ca58025ce8 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Wed, 28 Jan 2026 22:44:48 -0800 Subject: [PATCH] Log notarization failures in release workflow --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e94343ee..810c98fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,22 @@ jobs: ZIP_SUBMIT="cmuxterm-notary.zip" DMG_RELEASE="cmuxterm-macos.dmg" ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "$ZIP_SUBMIT" - xcrun notarytool submit "$ZIP_SUBMIT" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --wait + APP_SUBMIT_JSON="$(xcrun notarytool submit "$ZIP_SUBMIT" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --wait --output-format json)" + APP_SUBMIT_ID="$(python3 - <<'PY' +import json,sys +print(json.loads(sys.stdin.read())["id"]) +PY +<<<"$APP_SUBMIT_JSON")" + APP_STATUS="$(python3 - <<'PY' +import json,sys +print(json.loads(sys.stdin.read())["status"]) +PY +<<<"$APP_SUBMIT_JSON")" + if [ "$APP_STATUS" != "Accepted" ]; then + echo "App notarization failed with status: $APP_STATUS" >&2 + xcrun notarytool log "$APP_SUBMIT_ID" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" || true + exit 1 + fi xcrun stapler staple "$APP_PATH" xcrun stapler validate "$APP_PATH" spctl -a -vv --type execute "$APP_PATH" @@ -115,7 +130,22 @@ jobs: ln -s /Applications "$STAGING_DIR/Applications" hdiutil create -volname "cmuxterm" -srcfolder "$STAGING_DIR" -ov -format UDZO "$DMG_RELEASE" rm -rf "$STAGING_DIR" - xcrun notarytool submit "$DMG_RELEASE" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --wait + DMG_SUBMIT_JSON="$(xcrun notarytool submit "$DMG_RELEASE" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --wait --output-format json)" + DMG_SUBMIT_ID="$(python3 - <<'PY' +import json,sys +print(json.loads(sys.stdin.read())["id"]) +PY +<<<"$DMG_SUBMIT_JSON")" + DMG_STATUS="$(python3 - <<'PY' +import json,sys +print(json.loads(sys.stdin.read())["status"]) +PY +<<<"$DMG_SUBMIT_JSON")" + if [ "$DMG_STATUS" != "Accepted" ]; then + echo "DMG notarization failed with status: $DMG_STATUS" >&2 + xcrun notarytool log "$DMG_SUBMIT_ID" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" || true + exit 1 + fi xcrun stapler staple "$DMG_RELEASE" xcrun stapler validate "$DMG_RELEASE"