forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fastfile
333 lines (278 loc) · 10.2 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
skip_docs
opt_out_usage
platform :android do
desc "Generate a new local APK for e2e testing"
lane :build_e2e do
ENV["ENVFILE"]="tests/e2e/.env.e2e"
ENV["ENTRY_FILE"]="src/libs/E2E/reactNativeLaunchingTest.ts"
ENV["E2E_TESTING"]="true"
gradle(
project_dir: './android',
task: ':app:assemble',
flavor: 'e2e',
build_type: 'Release',
)
end
lane :build_e2edelta do
ENV["ENVFILE"]="tests/e2e/.env.e2edelta"
ENV["ENTRY_FILE"]="src/libs/E2E/reactNativeLaunchingTest.ts"
ENV["E2E_TESTING"]="true"
gradle(
project_dir: './android',
task: ':app:assemble',
flavor: 'e2edelta',
build_type: 'Release',
)
end
desc "Generate a new local APK"
lane :build do
ENV["ENVFILE"]=".env.production"
gradle(
project_dir: './android',
task: 'assemble',
flavor: 'Production',
build_type: 'Release',
)
end
desc "Build app for testing"
lane :build_internal do
ENV["ENVFILE"]=".env.adhoc"
gradle(
project_dir: './android',
task: 'assemble',
flavor: 'Adhoc',
build_type: 'Release',
)
aws_s3(
access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
bucket: ENV['S3_BUCKET'],
region: ENV['S3_REGION'],
apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
app_directory: "android/#{ENV['PULL_REQUEST_NUMBER']}",
)
sh("echo '{\"apk_path\": \"#{lane_context[SharedValues::S3_APK_OUTPUT_PATH]}\",\"html_path\": \"#{lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}\"}' > ../android_paths.json")
end
desc "Build and upload app to Google Play"
lane :beta do
ENV["ENVFILE"]=".env.production"
# Google is very unreliable, so we retry a few times
ENV["SUPPLY_UPLOAD_MAX_RETRIES"]="5"
gradle(
project_dir: './android',
task: 'bundle',
flavor: 'Production',
build_type: 'Release',
)
upload_to_play_store(
package_name: "com.expensify.chat",
json_key: './android/app/android-fastlane-json-key.json',
aab: './android/app/build/outputs/bundle/productionRelease/app-production-release.aab',
track: 'internal',
rollout: '1.0'
)
end
desc "Deploy app to Google Play production"
lane :production do
# Google is very unreliable, so we retry a few times
ENV["SUPPLY_UPLOAD_MAX_RETRIES"]="5"
google_play_track_version_codes(
package_name: "com.expensify.chat",
json_key: './android/app/android-fastlane-json-key.json',
track: 'internal'
)
upload_to_play_store(
package_name: "com.expensify.chat",
json_key: './android/app/android-fastlane-json-key.json',
version_code: ENV["VERSION"].to_i,
track: 'internal',
track_promote_to: 'production',
rollout: '1.0',
skip_upload_apk: true,
skip_upload_aab: true,
skip_upload_metadata: true,
skip_upload_changelogs: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
end
platform :ios do
desc "Generate a local iOS production build"
lane :build do
ENV["ENVFILE"]=".env.production"
build_app(
workspace: "./ios/NewExpensify.xcworkspace",
scheme: "New Expensify"
)
end
desc "Build app for testing"
lane :build_internal do
require 'securerandom'
ENV["ENVFILE"]=".env.adhoc"
keychain_password = SecureRandom.uuid
create_keychain(
name: "ios-build.keychain",
password: keychain_password,
default_keychain: "true",
unlock: "true",
timeout: "3600",
add_to_search_list: "true"
)
import_certificate(
certificate_path: "./ios/Certificates.p12",
keychain_name: "ios-build.keychain",
keychain_password: keychain_password
)
install_provisioning_profile(
path: "./ios/expensify_chat_adhoc.mobileprovision"
)
build_app(
workspace: "./ios/NewExpensify.xcworkspace",
skip_profile_detection: true,
scheme: "New Expensify AdHoc",
xcargs: { :PROVISIONING_PROFILE_SPECIFIER => "expensify_chat_adhoc", },
export_method: "ad-hoc",
export_options: {
method: "ad-hoc",
provisioningProfiles: {
"com.expensify.chat.adhoc" => "expensify_chat_adhoc",
},
manageAppVersionAndBuildNumber: false
}
)
aws_s3(
access_key: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
bucket: ENV['S3_BUCKET'],
region: ENV['S3_REGION'],
ipa: lane_context[SharedValues::IPA_OUTPUT_PATH],
app_directory: "ios/#{ENV['PULL_REQUEST_NUMBER']}",
)
sh("echo '{\"ipa_path\": \"#{lane_context[SharedValues::S3_IPA_OUTPUT_PATH]}\",\"html_path\": \"#{lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}\"}' > ../ios_paths.json")
end
desc "Build and upload app to TestFlight"
lane :beta do
require 'securerandom'
ENV["ENVFILE"]=".env.production"
keychain_password = SecureRandom.uuid
create_keychain(
name: "ios-build.keychain",
password: keychain_password,
default_keychain: "true",
unlock: "true",
timeout: "3600",
add_to_search_list: "true"
)
import_certificate(
certificate_path: "./ios/Certificates.p12",
keychain_name: "ios-build.keychain",
keychain_password: keychain_password
)
install_provisioning_profile(
path: "./ios/chat_expensify_appstore.mobileprovision"
)
build_app(
workspace: "./ios/NewExpensify.xcworkspace",
scheme: "New Expensify",
output_name: "New Expensify.ipa",
export_options: {
manageAppVersionAndBuildNumber: false
}
)
begin
upload_to_testflight(
api_key_path: "./ios/ios-fastlane-json-key.json",
distribute_external: true,
notify_external_testers: true,
changelog: "Thank you for beta testing New Expensify, this version includes bug fixes and improvements.",
groups: ["Beta"],
demo_account_required: true,
beta_app_review_info: {
contact_email: ENV["APPLE_CONTACT_EMAIL"],
contact_first_name: "Andrew",
contact_last_name: "Gable",
contact_phone: ENV["APPLE_CONTACT_PHONE"],
demo_account_name: ENV["APPLE_DEMO_EMAIL"],
demo_account_password: ENV["APPLE_DEMO_PASSWORD"],
notes: "1. In the Expensify app, enter the email '[email protected]'. This will trigger a sign-in link to be sent to '[email protected]'
2. Navigate to https://account.proton.me/login, log into Proton Mail using '[email protected]' as email and the password associated with '[email protected]', provided above
3. Once logged into Proton Mail, navigate to your inbox and locate the email triggered in step 1. The email subject should be 'Your magic sign-in link for Expensify'
4. Open the email and copy the 6-digit sign-in code provided within
5. Return to the Expensify app and enter the copied 6-digit code in the designated login field"
}
)
rescue Exception => e
if e.message.include? "Another build is in review"
UI.important("Another build is already in external beta review. Skipping external beta review submission")
else
raise
end
end
upload_symbols_to_crashlytics(
app_id: "1:921154746561:ios:216bd10ccc947659027c40",
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH],
gsp_path: "./ios/GoogleService-Info.plist",
binary_path: "./ios/Pods/FirebaseCrashlytics/upload-symbols"
)
end
desc "Move app to App Store Review"
lane :production do
deliver(
api_key_path: "./ios/ios-fastlane-json-key.json",
# Skip HTMl report verification
force: true,
# VERSION will be set to the full build_number e.g. '1.0.92.0'
build_number: ENV["VERSION"],
# app_version needs to be set to the short version, without the last digit e.g. '1.0.92'
app_version: ENV["VERSION"].rpartition(".")[0],
# We want to submit the version for Apple to review
submit_for_review: true,
# We want to release the app as soon as it's approved
automatic_release: true,
# We need to upload metadata to upload the release notes which is required for rach new version
skip_metadata: false,
# We do not want to upload any screenshots
skip_screenshots: true,
# We do not have any binary to upload as it's already in TestFlight
skip_binary_upload: true,
# Reject the current build if there is one in review
reject_if_possible: true,
# We do not want to reset the ratings
reset_ratings: false,
# Precheck cannot check for in app purchases with the API key we use
precheck_include_in_app_purchases: false,
submission_information: {
# We currently do not use idfa: https://developer.apple.com/app-store/user-privacy-and-data-use/
add_id_info_uses_idfa: false,
# We do not need any additional compliance
export_compliance_compliance_required: false,
# We do not use any encrpytion
export_compliance_encryption_updated: false,
export_compliance_app_type: nil,
export_compliance_uses_encryption: false,
export_compliance_is_exempt: false,
export_compliance_contains_third_party_cryptography: false,
export_compliance_contains_proprietary_cryptography: false,
# We do not show any third party content
content_rights_contains_third_party_content: false,
# Indicate that our key has admin permissions
content_rights_has_rights: true
},
release_notes: {
'en-US' => "Improvements and bug fixes"
}
)
end
end