Skip to content

Commit 2abd912

Browse files
committed
Start calling the new ios_send_app_metrics action
1 parent c3f33ab commit 2abd912

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

fastlane/lanes/build.rb

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
SENTRY_PROJECT_SLUG_JETPACK = 'jetpack-ios'
66
APPCENTER_OWNER_NAME = 'automattic'
77
APPCENTER_OWNER_TYPE = 'organization'
8+
APP_THINNING_EXPORT_OPTIONS = { thinning: '<thin-for-all-variants>' }
9+
10+
# TODO: Remove this once I'm done with debugging the App Metrics endpoint
11+
ENV['APPMETRICS_BASE_URL'] = 'localhost'
12+
ENV['APPMETRICS_API_TOKEN'] = 'tok/1'
813

914
# Lanes related to Building and Testing the code
1015
#
@@ -198,7 +203,7 @@
198203
derived_data_path: DERIVED_DATA_PATH,
199204
export_team_id: get_required_env('INT_EXPORT_TEAM_ID'),
200205
export_method: 'enterprise',
201-
export_options: { method: 'enterprise' }
206+
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
202207
)
203208

204209
appcenter_upload(
@@ -217,6 +222,14 @@
217222
project_slug: SENTRY_PROJECT_SLUG_WORDPRESS,
218223
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
219224
)
225+
226+
ios_send_app_size_metrics(
227+
api_base_url: ENV['APPMETRICS_BASE_URL'],
228+
api_token: ENV['APPMETRICS_API_TOKEN'],
229+
app_name: 'wordpress',
230+
build_type: 'internal',
231+
app_version: ios_get_build_version,
232+
)
220233
end
221234

222235
# Builds the WordPress app for an Installable Build ("WordPress Alpha" scheme), and uploads it to App Center
@@ -247,7 +260,7 @@
247260
derived_data_path: DERIVED_DATA_PATH,
248261
export_team_id: ENV['INT_EXPORT_TEAM_ID'],
249262
export_method: 'enterprise',
250-
export_options: { method: 'enterprise' }
263+
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
251264
)
252265

253266
appcenter_upload(
@@ -268,6 +281,14 @@
268281
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
269282
)
270283

284+
ios_send_app_size_metrics(
285+
api_base_url: ENV['APPMETRICS_BASE_URL'],
286+
api_token: ENV['APPMETRICS_API_TOKEN'],
287+
app_name: 'wordpress',
288+
build_type: 'pr-installable-build',
289+
app_version: build_number,
290+
)
291+
271292
post_installable_build_pr_comment(app_name: 'WordPress', build_number: build_number, url_slug: 'WPiOS-One-Offs')
272293
end
273294

@@ -300,7 +321,7 @@
300321
derived_data_path: DERIVED_DATA_PATH,
301322
export_team_id: ENV['INT_EXPORT_TEAM_ID'],
302323
export_method: 'enterprise',
303-
export_options: { method: 'enterprise' }
324+
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
304325
)
305326

306327
appcenter_upload(
@@ -321,6 +342,14 @@
321342
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
322343
)
323344

345+
ios_send_app_size_metrics(
346+
api_base_url: ENV['APPMETRICS_BASE_URL'],
347+
api_token: ENV['APPMETRICS_API_TOKEN'],
348+
app_name: 'jetpack',
349+
build_type: 'pr-installable-build',
350+
app_version: build_number,
351+
)
352+
324353
post_installable_build_pr_comment(app_name: 'Jetpack', build_number: build_number, url_slug: 'jetpack-installable-builds')
325354
end
326355

0 commit comments

Comments
 (0)