From b11e6fe6ed9f9b3bb236a7e006ced6bc584fefb7 Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Thu, 7 Sep 2023 22:44:03 +0300 Subject: [PATCH] auto increase build_number for testflight --- ios/fastlane/Fastfile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 7f204f3..183f6f3 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -47,19 +47,26 @@ platform :ios do end desc "Description of what the lane does" - lane :deployToTestFlight do + lane :deployToTestFlight do |options| + skip_build_number_increase = options[:skip_build_number_increase] # optional, if not set, it gets the last from TestFlight then adds + 1 + app_store_connect_api_key( + key_id: APP_STORE_API_KEY_ID, + issuer_id: APP_STORE_API_KEY_ISSUER_ID, + key_filepath: APP_STORE_API_KEY_FILE, + is_key_content_base64: false, + in_house: false # optional but may be required if using match/sigh + ) + + if skip_build_number_increase.nil? + increment_build_number({ + build_number: latest_testflight_build_number(app_identifier: APP_IDENTIFIER) + 1 + }) + end + setupCodeSigning() ipa_name = "Release.ipa" buildReleaseIPA(ipa_name: ipa_name, method: "app-store") - app_store_connect_api_key( - key_id: APP_STORE_API_KEY_ID, - issuer_id: APP_STORE_API_KEY_ISSUER_ID, - key_filepath: APP_STORE_API_KEY_FILE, - is_key_content_base64: false, - in_house: false # optional but may be required if using match/sigh - ) - upload_to_testflight( skip_submission: true, ipa: "./builds/#{ipa_name}",