diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cd97a1..cdf2847 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,21 +84,33 @@ jobs: --apple-id "$APPLE_ID" \ --password "$APPLE_PASSWORD" \ --team-id "$APPLE_TEAM_ID" \ - --wait 2>&1) + --verbose \ + --wait 2>&1) || true echo "$SUBMIT_OUTPUT" # Extract submission ID SUBMISSION_ID=$(echo "$SUBMIT_OUTPUT" | grep "id:" | head -1 | awk '{print $2}') + # Check for known errors + if echo "$SUBMIT_OUTPUT" | grep -qi "agreement.*missing\|agreement.*expired"; then + echo "::error::Apple Developer agreement has expired or is missing. Visit https://appstoreconnect.apple.com/ and accept the pending agreements." + exit 1 + fi + # Check for success if echo "$SUBMIT_OUTPUT" | grep -q "status: Accepted"; then echo "Notarization succeeded" else echo "Notarization failed — fetching log..." - xcrun notarytool log "$SUBMISSION_ID" \ - --apple-id "$APPLE_ID" \ - --password "$APPLE_PASSWORD" \ - --team-id "$APPLE_TEAM_ID" + if [ -n "$SUBMISSION_ID" ]; then + xcrun notarytool log "$SUBMISSION_ID" \ + --apple-id "$APPLE_ID" \ + --password "$APPLE_PASSWORD" \ + --team-id "$APPLE_TEAM_ID" \ + --verbose || echo "Failed to fetch notarization log" + else + echo "No submission ID found — submit itself likely failed" + fi exit 1 fi