1010# https://docs.fastlane.tools/plugins/available-plugins
1111#
1212
13+ require 'json'
14+
1315default_platform ( :ios )
1416
1517ENV [ "FASTLANE_SKIP_UPDATE_CHECK" ] = "1"
1618ENV [ "SPACESHIP_SKIP_2FA_UPGRADE" ] = "1"
1719
20+ project_path = ENV [ "PROJECT_PATH" ] || "Examples.xcodeproj"
21+ entitlement_path = "../Sources/Examples/Examples_CarPlay.entitlements"
22+ entitlement_absolute_path = File . absolute_path ( entitlement_path )
23+
24+ def read_json file_path , key
25+ JSON . parse ( File . read ( file_path ) ) [ key ]
26+ end
27+
28+ def examples_changelog
29+ maps = read_json ( File . absolute_path ( '../Sources/MapboxMaps/MapboxMaps.json' ) , 'version' )
30+ "Bump MapboxMaps version to #{ maps } "
31+ end
32+
33+ puts "Project Path: #{ project_path } "
34+ puts "Entitlement Path: #{ entitlement_absolute_path } "
35+
1836platform :ios do
1937
2038 lane :setup_distribution_cert do
@@ -39,22 +57,22 @@ platform :ios do
3957 sync_code_signing
4058 update_code_signing_settings (
4159 use_automatic_signing : false ,
42- path : "Examples.xcodeproj" ,
60+ path : project_path ,
4361 team_id : "GJZR2MEM28" , # Developer Portal Team ID,
4462 profile_name : lane_context [ SharedValues ::MATCH_PROVISIONING_PROFILE_MAPPING ] [ "mapbox.ExamplesUITests.xctrunner" ] ,
4563 targets : [ "ExamplesUITests" ] ,
4664 code_sign_identity : "Apple Development: Created via API" ,
4765 )
4866 update_code_signing_settings (
4967 use_automatic_signing : false ,
50- path : "Examples.xcodeproj" ,
68+ path : project_path ,
5169 team_id : "GJZR2MEM28" , # Developer Portal Team ID,
5270 profile_name : lane_context [ SharedValues ::MATCH_PROVISIONING_PROFILE_MAPPING ] [ "com.mapbox.examples" ] ,
5371 targets : [ "Examples" ] ,
5472 code_sign_identity : "Apple Development: Created via API" ,
5573 )
5674 run_tests (
57- project : 'Examples.xcodeproj' ,
75+ project : project_path ,
5876 scheme : 'Examples' , # XCTest scheme
5977 clean : true , # Recommended: This would ensure the build would not include unnecessary files
6078 # Use the Debug mode here to avoid the compiler crash
@@ -97,10 +115,18 @@ platform :ios do
97115
98116 lane :beta do
99117 api_key_if_needed # Generate API Token
118+ new_build_number = latest_testflight_build_number + 1
100119 increment_build_number (
101- build_number : latest_testflight_build_number + 1 ,
102- xcodeproj : 'Examples.xcodeproj'
120+ build_number : new_build_number ,
121+ xcodeproj : project_path
103122 )
123+
124+ if ENV [ 'GITHUB_OUTPUT' ]
125+ File . open ( ENV [ 'GITHUB_OUTPUT' ] , 'a' ) do |file |
126+ file . puts ( "build_number=#{ new_build_number } " )
127+ end
128+ end
129+
104130 build_and_submit
105131 end
106132
@@ -111,24 +137,28 @@ platform :ios do
111137 sync_code_signing ( type : "development" )
112138 update_code_signing_settings (
113139 use_automatic_signing : false ,
114- path : "Examples.xcodeproj" ,
140+ path : project_path ,
115141 team_id : "GJZR2MEM28" , # Developer Portal Team ID,
116142 profile_name : lane_context [ SharedValues ::MATCH_PROVISIONING_PROFILE_MAPPING ] [ "com.mapbox.examples" ] ,
117143 targets : [ "Examples" ] ,
118144 code_sign_identity : "Apple Development: Created via API" ,
119- entitlements_file_path : "Sources/Examples/Examples_CarPlay.entitlements"
145+ entitlements_file_path : entitlement_absolute_path
120146 )
121147 sync_code_signing ( type : "appstore" )
122148 build_app (
123149 scheme : "Examples" ,
124- project : "Examples.xcodeproj" ,
150+ project : project_path ,
151+ export_method : "app-store" ,
125152 xcargs : "SWIFT_TREAT_WARNINGS_AS_ERRORS=NO COMPILER_INDEX_STORE_ENABLE=NO" # Disable to bypass Deprecated error on OfflineManager example
126153 )
127154 upload_to_testflight (
128155 beta_app_feedback_email :
"[email protected] " , 129156 beta_app_description : "Examples app test build." ,
130157 demo_account_required : false ,
131- skip_waiting_for_build_processing : true
158+ skip_waiting_for_build_processing : false ,
159+ distribute_external : true ,
160+ groups : [ "Mobot" , "Mapbox Testers" ] ,
161+ changelog : examples_changelog
132162 )
133163 end
134164
0 commit comments