mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
The Fastfile called wait_for_build_processing_to_be_complete, which isn't a built-in fastlane action and isn't published as a plugin anywhere on rubygems. The submit_review lane has therefore failed on every release that reached it (v0.1.65-beta.1, v0.1.66, v0.1.67). Replace it with a direct Spaceship::ConnectAPI poll: fetch the build matching the latest TestFlight build number, wait until its processing_state is VALID, then hand off to deliver. 30-minute cap with a clear failure message on INVALID/FAILED or timeout. Spaceship ships with fastlane so no plugin or extra gem is required. Lands in the next release; v0.1.67 needs a manual review submission from App Store Connect.
66 lines
2.0 KiB
Ruby
66 lines
2.0 KiB
Ruby
default_platform(:ios)
|
|
|
|
APP_IDENTIFIER = "sh.paseo"
|
|
|
|
platform :ios do
|
|
desc "Submit the latest TestFlight build to App Store Review"
|
|
lane :submit_review do
|
|
api_key = app_store_connect_api_key(
|
|
key_id: ENV.fetch("ASC_KEY_ID"),
|
|
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
|
|
key_filepath: ENV.fetch("ASC_KEY_P8"),
|
|
)
|
|
|
|
build_number = latest_testflight_build_number(
|
|
api_key: api_key,
|
|
app_identifier: APP_IDENTIFIER,
|
|
)
|
|
|
|
require "spaceship"
|
|
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(
|
|
key_id: ENV.fetch("ASC_KEY_ID"),
|
|
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
|
|
filepath: ENV.fetch("ASC_KEY_P8"),
|
|
)
|
|
app = Spaceship::ConnectAPI::App.find(APP_IDENTIFIER)
|
|
UI.user_error!("Could not find app #{APP_IDENTIFIER} on App Store Connect") if app.nil?
|
|
|
|
deadline = Time.now + (30 * 60)
|
|
loop do
|
|
builds = Spaceship::ConnectAPI::Build.all(
|
|
app_id: app.id,
|
|
filter: { "version" => build_number.to_s },
|
|
includes: "preReleaseVersion",
|
|
)
|
|
build = builds.find { |b| b.pre_release_version&.platform == "IOS" }
|
|
state = build&.processing_state
|
|
UI.message("Build #{build_number} processing state: #{state || 'unknown'}")
|
|
break if state == "VALID"
|
|
if state == "INVALID" || state == "FAILED"
|
|
UI.user_error!("Build #{build_number} failed App Store processing (state: #{state}).")
|
|
end
|
|
if Time.now > deadline
|
|
UI.user_error!("Timed out waiting for build #{build_number} to finish processing on App Store Connect.")
|
|
end
|
|
sleep(30)
|
|
end
|
|
|
|
deliver(
|
|
api_key: api_key,
|
|
app_identifier: APP_IDENTIFIER,
|
|
build_number: build_number.to_s,
|
|
submit_for_review: true,
|
|
automatic_release: true,
|
|
force: true,
|
|
skip_binary_upload: true,
|
|
skip_screenshots: true,
|
|
skip_metadata: true,
|
|
precheck_include_in_app_purchases: false,
|
|
submission_information: {
|
|
add_id_info_uses_idfa: false,
|
|
export_compliance_uses_encryption: false,
|
|
},
|
|
)
|
|
end
|
|
end
|