diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 60d60934c2ba..aba3430d9f72 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -243,6 +243,26 @@ platform :ios do desc "Move app to App Store Review" lane :production do + # Login to Spaceship + fastlane_require 'spaceship' + teamID = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) + Spaceship::ConnectAPI.login( + use_portal: false, + tunes_team_id: teamID, + ) + + # Find our app + bundleID = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + app = Spaceship::ConnectAPI::App.find(bundleID) + if app.nil? + UI.important "not found in team #{teamID} on ASC!" + next + else + # If there's an app that's Pending Developer Release, release it before continuing with the new version + pendingReviewVersion = app.get_pending_release_app_store_version + version.create_app_store_version_release_request unless version.nil? + end + deliver( api_key_path: "./ios/ios-fastlane-json-key.json",