diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index c1244bd9..1f9668f6 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -51,7 +51,24 @@ jobs: flutter pub run build_runner build --delete-conflicting-outputs cd ios pod update - fastlane beta + # Install/update fastlane + bundle install + # Retry logic for fastlane upload + for i in {1..3}; do + echo "Attempt $i of 3 for fastlane upload" + if bundle exec fastlane beta; then + echo "Fastlane upload successful on attempt $i" + break + else + echo "Fastlane upload failed on attempt $i" + if [ $i -eq 3 ]; then + echo "All attempts failed" + exit 1 + fi + echo "Waiting 30 seconds before retry..." + sleep 30 + fi + done env: LANG: en_US.UTF-8 LC_ALL: en_US.UTF-8 diff --git a/ios/Gemfile b/ios/Gemfile index 7a118b49..791ac593 100644 --- a/ios/Gemfile +++ b/ios/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem "fastlane" +gem "fastlane", "~> 2.217" diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index d9653264..72d89b2c 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -28,6 +28,28 @@ platform :ios do xcargs: "--dart-define=HIDE_PLANS=true" ) app_store_connect_api_key(key_id: "325JS9JCZH", issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3", key_filepath: "./AuthKey.p8") - upload_to_testflight + + # Try the newer upload method first, fallback to the older one + begin + upload_to_app_store_connect( + api_key_path: "./AuthKey.p8", + api_key_id: "325JS9JCZH", + api_issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3", + skip_metadata: true, + skip_screenshots: true, + precheck_include_in_app_purchases: false + ) + rescue => e + UI.message("upload_to_app_store_connect failed, trying upload_to_testflight: #{e.message}") + upload_to_testflight( + skip_waiting_for_build_processing: true, + skip_submission: true, + reject_if_possible: false, + precheck_include_in_app_purchases: false, + api_key_path: "./AuthKey.p8", + api_key_id: "325JS9JCZH", + api_issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3" + ) + end end end