Skip to content

Commit 864b941

Browse files
committed
Calling ios_send_app_metrics action
1 parent 279ecf3 commit 864b941

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

fastlane/lanes/build.rb

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
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>' }
89

910
# Lanes related to Building and Testing the code
1011
#
@@ -198,7 +199,7 @@
198199
derived_data_path: DERIVED_DATA_PATH,
199200
export_team_id: get_required_env('INT_EXPORT_TEAM_ID'),
200201
export_method: 'enterprise',
201-
export_options: { method: 'enterprise' }
202+
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
202203
)
203204

204205
appcenter_upload(
@@ -217,6 +218,16 @@
217218
project_slug: SENTRY_PROJECT_SLUG_WORDPRESS,
218219
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
219220
)
221+
222+
ios_send_app_size_metrics(
223+
api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'wordpress-app-size-metrics.json'),
224+
api_token: ENV['APPMETRICS_API_TOKEN'],
225+
use_gzip_content_encoding: false,
226+
app_name: 'WordPress',
227+
app_version: ios_get_build_version,
228+
build_type: 'Release',
229+
source: 'Beta'
230+
)
220231
end
221232

222233
# Builds the WordPress app for an Installable Build ("WordPress Alpha" scheme), and uploads it to App Center
@@ -247,7 +258,7 @@
247258
derived_data_path: DERIVED_DATA_PATH,
248259
export_team_id: ENV['INT_EXPORT_TEAM_ID'],
249260
export_method: 'enterprise',
250-
export_options: { method: 'enterprise' }
261+
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
251262
)
252263

253264
appcenter_upload(
@@ -268,6 +279,16 @@
268279
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
269280
)
270281

282+
ios_send_app_size_metrics(
283+
api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'wordpress-app-size-metrics.json'),
284+
api_token: ENV['APPMETRICS_API_TOKEN'],
285+
use_gzip_content_encoding: false,
286+
app_name: 'WordPress',
287+
app_version: build_number,
288+
build_type: 'Release-Alpha'
289+
source: 'PR Installable Build',
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,16 @@
321342
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
322343
)
323344

345+
ios_send_app_size_metrics(
346+
api_url: File.join('file://localhost/', BUILD_PRODUCTS_PATH, 'jetpack-app-size-metrics.json'),
347+
api_token: ENV['APPMETRICS_API_TOKEN'],
348+
use_gzip_content_encoding: false,
349+
app_name: 'Jetpack',
350+
app_version: build_number,
351+
build_type: 'Release-Alpha'
352+
source: 'PR Installable Build',
353+
)
354+
324355
post_installable_build_pr_comment(app_name: 'Jetpack', build_number: build_number, url_slug: 'jetpack-installable-builds')
325356
end
326357

0 commit comments

Comments
 (0)