Skip to content

Commit d481d01

Browse files
committed
Call android_send_app_metrics action
1 parent 9197667 commit d481d01

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

fastlane/lanes/build.rb

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,23 @@
2626
# Create the file names
2727
app = get_app_name_option!(options)
2828
version = android_get_release_version()
29-
build_bundle(app: app, version: version, flavor: 'Vanilla', buildType: 'Release')
29+
aab_path = build_bundle(app: app, version: version, flavor: 'Vanilla', buildType: 'Release')
3030

3131
upload_build_to_play_store(app: app, version: version, track: 'production')
3232

3333
create_gh_release(app: app, version: version) if options[:create_release]
34+
35+
android_send_app_size_metrics(
36+
api_url: ENV['APPMETRICS_BASE_URL'] = File.join('file://localhost/', ENV['PROJECT_ROOT_FOLDER'], 'build', "#{app}-app-size-metrics.json"),
37+
use_gzip_content_encoding: false,
38+
app_name: 'WordPress',
39+
app_version_name: version['name'],
40+
app_version_code: version['code'],
41+
product_flavor: 'Vanilla',
42+
build_type: 'Release',
43+
source: 'Final Build',
44+
aab_path: aab_path
45+
)
3446
end
3547

3648
#####################################################################################
@@ -81,11 +93,23 @@
8193
# Create the file names
8294
app = get_app_name_option!(options)
8395
version = android_get_alpha_version()
84-
build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Release')
96+
aab_path = build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Release')
8597

8698
upload_build_to_play_store(app: app, version: version, track: 'alpha') if options[:upload_to_play_store]
8799

88100
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
101+
102+
android_send_app_size_metrics(
103+
api_url: ENV['APPMETRICS_BASE_URL'] = File.join('file://localhost/', ENV['PROJECT_ROOT_FOLDER'], 'build', "#{app}-app-size-metrics.json"),
104+
use_gzip_content_encoding: false,
105+
app_name: 'WordPress',
106+
app_version_name: version['name'],
107+
app_version_code: version['code'],
108+
product_flavor: 'Zalpha',
109+
build_type: 'Release',
110+
source: 'Alpha',
111+
aab_path: aab_path
112+
)
89113
end
90114

91115
#####################################################################################
@@ -109,11 +133,23 @@
109133
# Create the file names
110134
app = get_app_name_option!(options)
111135
version = android_get_release_version()
112-
build_bundle(app: app, version: version, flavor: 'Vanilla', buildType: 'Release')
136+
aab_path = build_bundle(app: app, version: version, flavor: 'Vanilla', buildType: 'Release')
113137

114138
upload_build_to_play_store(app: app, version: version, track: 'beta') if options[:upload_to_play_store]
115139

116140
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
141+
142+
android_send_app_size_metrics(
143+
api_url: ENV['APPMETRICS_BASE_URL'] = File.join('file://localhost/', ENV['PROJECT_ROOT_FOLDER'], 'build', "#{app}-app-size-metrics.json"),
144+
use_gzip_content_encoding: false,
145+
app_name: 'WordPress',
146+
app_version_name: version['name'],
147+
app_version_code: version['code'],
148+
product_flavor: 'Vanilla',
149+
build_type: 'Release',
150+
source: 'Beta',
151+
aab_path: aab_path
152+
)
117153
end
118154

119155
#####################################################################################
@@ -137,11 +173,23 @@
137173
# Create the file names
138174
app = get_app_name_option!(options)
139175
version = android_get_release_version()
140-
build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Debug')
176+
aab_path = build_bundle(app: app, version: version, flavor: 'Zalpha', buildType: 'Debug')
141177

142178
upload_build_to_play_store(app: app, version: version, track: 'internal') if options[:upload_to_play_store]
143179

144180
create_gh_release(app: app, version: version, prerelease: true) if options[:create_release]
181+
182+
android_send_app_size_metrics(
183+
api_url: ENV['APPMETRICS_BASE_URL'] = File.join('file://localhost/', ENV['PROJECT_ROOT_FOLDER'], 'build', "#{app}-app-size-metrics.json"),
184+
use_gzip_content_encoding: false,
185+
app_name: 'WordPress',
186+
app_version_name: version['name'],
187+
app_version_code: version['code'],
188+
product_flavor: 'Zalpha',
189+
build_type: 'Debug',
190+
source: 'Internal',
191+
aab_path: aab_path
192+
)
145193
end
146194

147195
#####################################################################################

0 commit comments

Comments
 (0)