From 2bac88b110e8619253100bdcd132100698b0ecfe Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sun, 6 Sep 2026 21:51:18 +0800 Subject: [PATCH] fix(release): wait for App Store build processing --- .github/workflows/store-delivery.yml | 16 +++++++++++++++- scripts/store-delivery.test.mjs | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/store-delivery.yml b/.github/workflows/store-delivery.yml index 06367359..9d1f45ee 100644 --- a/.github/workflows/store-delivery.yml +++ b/.github/workflows/store-delivery.yml @@ -358,5 +358,19 @@ jobs: test -n "$APP_STORE_CONNECT_API_ISSUER_ID" test -n "$APP_STORE_CONNECT_API_KEY_ID" test -n "$APP_STORE_CONNECT_API_KEY_P8_BASE64" - bundle exec fastlane ios submit_review + log_file="$RUNNER_TEMP/edgeever-app-store-review.log" + for attempt in {1..20}; do + set +e + bundle exec fastlane ios submit_review 2>&1 | tee "$log_file" + status="${PIPESTATUS[0]}" + set -e + if [[ "$status" -eq 0 ]]; then + exit 0 + fi + if ! grep -Fq "Build number: ${APP_STORE_BUILD_NUMBER} does not exist" "$log_file" || [[ "$attempt" -eq 20 ]]; then + exit "$status" + fi + echo "App Store Connect has not exposed build ${APP_STORE_BUILD_NUMBER} yet; retrying in 60 seconds (${attempt}/20)." + sleep 60 + done working-directory: apps/mobile diff --git a/scripts/store-delivery.test.mjs b/scripts/store-delivery.test.mjs index 67072f48..8c3158d4 100644 --- a/scripts/store-delivery.test.mjs +++ b/scripts/store-delivery.test.mjs @@ -84,6 +84,11 @@ describe("store delivery command", () => { expect(workflow).toContain( 'PRECHECK_INCLUDE_IN_APP_PURCHASES: "false"', ); + expect(workflow).toContain("for attempt in {1..20}"); + expect(workflow).toContain( + 'Build number: ${APP_STORE_BUILD_NUMBER} does not exist', + ); + expect(workflow).toContain("retrying in 60 seconds (${attempt}/20)"); const fastfile = readFileSync( new URL("../apps/mobile/fastlane/Fastfile", import.meta.url), "utf8",