OPS: Retry upload to TF lane 3 times (#5886)

This commit is contained in:
Marcos Rodriguez Vélez 2023-12-06 18:13:57 -04:00 committed by GitHub
parent 830a653051
commit 1b3177a5e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,15 +105,30 @@ platform :ios do
desc "Upload to TestFlight" desc "Upload to TestFlight"
lane :upload_to_testflight_lane do lane :upload_to_testflight_lane do
UI.message("Uploading to TestFlight...") attempts = 0
changelog = ENV["LATEST_COMMIT_MESSAGE"] max_attempts = 3
begin
UI.message("Uploading to TestFlight...")
changelog = ENV["LATEST_COMMIT_MESSAGE"]
upload_to_testflight( upload_to_testflight(
api_key_path: "appstore_api_key.json", api_key_path: "appstore_api_key.json",
ipa: "./build/BlueWallet_#{ENV['NEW_BUILD_NUMBER']}.ipa", ipa: "./build/BlueWallet_#{ENV['NEW_BUILD_NUMBER']}.ipa",
skip_waiting_for_build_processing: true, skip_waiting_for_build_processing: true,
changelog: changelog changelog: changelog
) )
rescue => exception
attempts += 1
if attempts < max_attempts
wait_time = 60 # Time in seconds
UI.message("Attempt ##{attempts} failed, waiting #{wait_time} seconds before trying again...")
sleep(wait_time)
retry
else
UI.error("Failed after #{max_attempts} attempts. Error: #{exception.message}")
raise exception
end
end
end end
desc "Deploy to TestFlight" desc "Deploy to TestFlight"