Skip to content

Commit 833af84

Browse files
committed
Make CI send metrics for Installable Builds too
Which implies Jalapeno Debug Universal APK (and no AAB)
1 parent 4bd0258 commit 833af84

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
mkdir -p Artifacts
7070
mv WordPress/build/outputs/apk/wordpressJalapeno/debug/org.wordpress.android-wordpress-jalapeno-debug.apk "Artifacts/WordPress-${VERSION_NAME}.apk"
7171
mv WordPress/build/outputs/apk/jetpackJalapeno/debug/org.wordpress.android-jetpack-jalapeno-debug.apk "Artifacts/Jetpack-${VERSION_NAME}.apk"
72+
- run:
73+
name: Send App Size Metrics
74+
command: |
75+
fastlane send_installable_build_app_metrics apk:"Artifacts/WordPress-${VERSION_NAME}.apk" app_name:WordPress version_name:"${VERSION_NAME}"
76+
fastlane send_installable_build_app_metrics apk:"Artifacts/Jetpack-${VERSION_NAME}.apk" app_name:Jetpack version_name:"${VERSION_NAME}"
7277
- store_artifacts:
7378
path: Artifacts
7479
destination: Artifacts

fastlane/lanes/build.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,25 @@
310310
end
311311
"#{build_dir}#{name}"
312312
end
313+
314+
# Send Universal APK app size metrics for Installable Builds
315+
# @called_by CI
316+
#
317+
# @option [String,Symbol] apk The path to the Universal APK to send metrics for
318+
# @option [String] app_name The display name of the app to send metrics for. "WordPress" or "Jetpack"
319+
# @option [String] version_name The `versionName` of the APK
320+
#
321+
lane :send_installable_build_app_metrics do |options|
322+
basename = File.basename(options[:apk], '.apk')
323+
android_send_app_size_metrics(
324+
api_url: ENV['APPMETRICS_BASE_URL'] = File.join('file://localhost/', ENV['PROJECT_ROOT_FOLDER'], 'Artifacts', "#{basename}-app-size-metrics.json"),
325+
use_gzip_content_encoding: false,
326+
app_name: options[:app_name],
327+
app_version_name: options[:version_name],
328+
product_flavor: 'Jalapeno',
329+
build_type: 'Debug',
330+
source: 'Installable Build',
331+
universal_apk_path: options[:apk]
332+
)
333+
end
313334
end

0 commit comments

Comments
 (0)