@@ -24,8 +24,11 @@ platform :ios do
2424 export_options : {
2525 provisioningProfiles : {
2626 "v2er.app" => "match AppStore v2er.app"
27- }
27+ } ,
28+ teamID : ENV [ "TEAM_ID" ]
2829 } ,
30+ export_team_id : ENV [ "TEAM_ID" ] ,
31+ xcargs : "-allowProvisioningUpdates" ,
2932 clean : true ,
3033 output_directory : "./build" ,
3134 output_name : "V2er.ipa"
@@ -50,9 +53,25 @@ platform :ios do
5053 # Get App Store Connect API key
5154 api_key = get_api_key
5255
53- # Increment build number to avoid conflicts
54- increment_build_number (
55- build_number : latest_testflight_build_number ( api_key : api_key ) + 1
56+ # Get the latest TestFlight build number and increment
57+ current_build_number = get_build_number ( xcodeproj : "V2er.xcodeproj" ) . to_i
58+ latest_testflight = latest_testflight_build_number ( api_key : api_key )
59+
60+ # Only increment if needed
61+ if latest_testflight >= current_build_number
62+ increment_build_number (
63+ build_number : latest_testflight + 1 ,
64+ xcodeproj : "V2er.xcodeproj"
65+ )
66+ end
67+
68+ # Ensure proper code signing
69+ update_code_signing_settings (
70+ use_automatic_signing : false ,
71+ path : "V2er.xcodeproj" ,
72+ team_id : ENV [ "TEAM_ID" ] ,
73+ profile_name : "match AppStore v2er.app" ,
74+ code_sign_identity : "iPhone Distribution"
5675 )
5776
5877 # Build the app
0 commit comments