1- # If you want to automatically update fastlane if a new version is available:
2- #update_fastlane
3-
4- # This is the minimum version number required.
5- # Update this, if you use features of a newer version
6- fastlane_version "2.213.0"
7-
8- default_platform :ios
9-
10- # Constants
11- APPLE_STORE_VERSION = sh ( "node -p -e \" require('../../package.json')['store-versions']['apple-store']\" " ) . chomp
12- BUILD_NUMBER = 1
13- ORIGINAL_CHANGELOG_PATH = "../../CHANGELOG.ios.txt"
14- FASTLANE_CHANGELOG_PATH = "./metadata/default/release_notes.txt"
15-
161platform :ios do
17- lane :install_dev_certificate do
18- # Improve DX. We cannot use an empty password, so we use the public password.
19- ENV [ "MATCH_PASSWORD" ] = "AppleDeveloper1!"
20- match (
21- type : "development" ,
22- git_branch : "appdev" ,
23- profile_name : "Make It Native 9 Dev (Match)" ,
24- readonly : true ,
25- )
26- end
27-
28- desc "Build an internal version for automation"
29- desc "It always uses v.0.0.0 and build number 0 by design"
30- lane :internal do
31- sh ( "npm" , "ci" , "--legacy-peer-deps" )
32- cocoapods
33- increment_version_number (
34- version_number : "0.0.0" ,
35- )
36- gym ( scheme : "DeveloperApp" , configuration : "ReleaseDevToolsEnabled" , export_method : "development" , build_path : "./builds/internal/intermediate" , output_directory : "./builds/internal/output" )
37- end
38-
39- desc "Builds and installs DeveloperApp into the simulator for debugging"
40- lane :debug_internal do
2+ before_all do
413 UI . message ( "Installing dependencies" )
424 sh ( "npm" , "ci" , "--legacy-peer-deps" ) # Install npm dependencies
435 cocoapods # Install CocoaPods dependencies
44-
45- UI . message ( "Building DeveloperApp for Debug" )
46- gym (
47- scheme : "DeveloperApp" , # Replace with your app's scheme name
48- configuration : "Debug" , # Use Debug configuration
49- skip_package_ipa : true , # Skip creating an .ipa file
50- skip_package_pkg : true , # Skip creating a .pkg file
51- sdk : "iphonesimulator" , # Build for the iOS Simulator
52- destination : "platform=iOS Simulator,name=iPhone 13 Pro,OS=15.5" , # Target simulator
53- xcargs : "ONLY_ACTIVE_ARCH=NO" , # Ensure compatibility with all architectures
54- )
55- end
56-
57- desc "Submit a new Beta Build to Apple TestFlight"
58- desc "This will also make sure the profile is up to date"
59- lane :beta do |options |
60- keychain_name = "min_10_ios"
61- sh ( "npm" , "ci" , "--legacy-peer-deps" )
62- cocoapods
63-
64- UI . message ( "Connect API key" )
65- app_store_connect_api_key (
66- is_key_content_base64 : true ,
67- )
68-
69- create_keychain (
70- name : keychain_name ,
71- unlock : true ,
72- timeout : 0 ,
73- default_keychain : true ,
74- )
75-
76- UI . message ( "Retrieve iOS certificate and profile" )
77- match (
78- type : "appstore" ,
79- keychain_name : keychain_name ,
80- keychain_password : ENV [ "KEYCHAIN_PASSWORD" ] ,
81- profile_name : "match AppStore com.mendix.developerapp.native.mx10" ,
82- readonly : true ,
83- )
84-
85- UI . message ( "Set version number" )
86- increment_version_number (
87- version_number : APPLE_STORE_VERSION ,
88- )
89-
90- UI . message ( "Set build number" )
91- increment_build_number (
92- build_number : app_store_build_number ( live : false , version : APPLE_STORE_VERSION , initial_build_number : 0 ) + 1 ,
93- )
94-
95- unlock_keychain ( # Unlock an existing keychain and add it to the keychain search list
96- path : keychain_name ,
97- password : ENV [ "KEYCHAIN_PASSWORD" ] ,
98- )
99-
100- update_project_provisioning (
101- xcodeproj : "developerapp.xcodeproj" ,
102- code_signing_identity : "Apple Distribution" ,
103- profile : ENV [ "sigh_com.mendix.developerapp.native.mx10_appstore_profile-path" ] ,
104- build_configuration : "Release" ,
105- target_filter : "DeveloperApp" ,
106- )
107-
108- UI . message ( "Replacing Google Maps API key from environment variables" )
109- Dir . chdir ( "../DeveloperApp/Config" ) do
110- googleMapsApiKey = ENV [ "GOOGLE_MAPS_API_KEY" ] || "GOOGLE_MAPS_API_KEY"
111- sh ( "sed -i '' 's/{{google-maps-api-key}}/#{ googleMapsApiKey } /g' ApiKeys.xcconfig" )
112- end
113-
114- UI . message ( "Build iOS app" )
115- gym (
116- scheme : "DeveloperApp" ,
117- export_method : "app-store" ,
118- configuration : "Release" ,
119- output_directory : "./build/beta/output" ,
120- )
121-
122- if options [ :submit ] == true
123- UI . message ( "Send iOS app to TestFlight" )
124- pilot (
125- groups : [ "Internal Testers" ] ,
126- skip_submission : true ,
127- skip_waiting_for_build_processing : true ,
128- distribute_external : false
129- )
130- end
131-
132- UI . message ( "Copy artifacts" )
133- copy_artifacts (
134- target_path : "../artifacts" ,
135- artifacts : [ "./build/beta/output/DeveloperApp.ipa" ,
136- "./build/beta/output/DeveloperApp.app.dSYM.zip" ] ,
137- )
1386 end
1397
140- lane :beta_manually do
141- sh ( "npm" , "ci" , "--legacy-peer-deps" )
142- cocoapods
143-
144- UI . message ( "Retrieve iOS certificate and profile" )
145- match (
146- type : "appstore" ,
147- profile_name : "match AppStore com.mendix.developerapp.native.mx10" ,
148- readonly : true ,
149- )
150-
151- UI . message ( "Set version number" )
152- increment_version_number (
153- version_number : APPLE_STORE_VERSION ,
154- )
155-
156- UI . message ( "Set build number" )
157- increment_build_number (
158- build_number : app_store_build_number ( live : false , version : APPLE_STORE_VERSION , initial_build_number : 0 ) + 1 ,
159- )
160-
161- UI . message ( "Build iOS app" )
8+ desc "Builds DeveloperApp for Debug and generates an .ipa file"
9+ lane :debug_internal do
10+ UI . message ( "Building DeveloperApp for Debug and generating .ipa" )
16211 gym (
163- scheme : "DeveloperApp" ,
164- export_method : "app-store" ,
165- configuration : "Release" ,
166- output_directory : "./build/beta/output" ,
167- )
168-
169- UI . message ( "Send iOS app to TestFlight" )
170- pilot (
171- skip_submission : true ,
172- skip_waiting_for_build_processing : true ,
173- )
174-
175- UI . message ( "Copy artifacts" )
176- copy_artifacts (
177- target_path : "../artifacts" ,
178- artifacts : [ "./build/beta/output/DeveloperApp.ipa" ,
179- "./build/beta/output/DeveloperApp.app.dSYM.zip" ] ,
180- )
181- end
182-
183- desc "Send appstore version to review"
184- lane :promote_to_production do |options |
185- if !options [ :build_number ]
186- UI . user_error! ( "build_number is required to release app" )
187- end
188-
189- FileUtils . copy ( ORIGINAL_CHANGELOG_PATH , FASTLANE_CHANGELOG_PATH )
190-
191- UI . message ( "Connect API key" )
192- app_store_connect_api_key (
193- is_key_content_base64 : true ,
194- )
195-
196- deliver (
197- app_version : APPLE_STORE_VERSION ,
198- build_number : options [ :build_number ] ,
199- submit_for_review : true ,
200- automatic_release : true ,
201- force : true ,
202- skip_metadata : false ,
203- skip_screenshots : true ,
204- skip_binary_upload : true ,
205- precheck_include_in_app_purchases : false ,
206- submission_information : {
207- add_id_info_uses_idfa : false ,
208- export_compliance_uses_encryption : false ,
209- } ,
12+ scheme : "DeveloperApp" , # Replace with your app's scheme name
13+ configuration : "Debug" , # Use Debug configuration
14+ output_directory : "./build" , # Directory where the .ipa will be saved
15+ output_name : "DeveloperApp-Debug.ipa" , # Name of the .ipa file
16+ export_method : "development" , # Use development export method for debug builds
17+ include_bitcode : false , # Optional: Exclude bitcode for faster builds
18+ include_symbols : true , # Include debug symbols for debugging
21019 )
21120 end
212- end
21+ end
0 commit comments