Skip to content

Commit f9adbfa

Browse files
authored
Merge pull request #17199 from wordpress-mobile/tooling/installable-build-comment-improvement
[Tooling] Improve the Installable Build comment
2 parents 01c90d2 + bd865c2 commit f9adbfa

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

fastlane/Fastfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ APP_SPECIFIC_VALUES = {
1818
}.freeze
1919

2020
UPLOAD_TO_PLAY_STORE_JSON_KEY = File.join(Dir.home, '.configure', 'wordpress-android', 'secrets', 'google-upload-credentials.json')
21+
22+
INSTALLABLE_BUILD_FLAVOR = 'Jalapeno'.freeze
23+
INSTALLABLE_BUILD_TYPE = 'Debug'.freeze
2124
INSTALLABLE_BUILD_DOMAIN = 'https://d2twmm2nzpx3bg.cloudfront.net'
25+
2226
PROJECT_ROOT_FOLDER = File.dirname(File.expand_path(__dir__))
2327

2428
########################################################################

fastlane/lanes/build.rb

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@
148148

149149
gradle(
150150
task: 'assemble',
151-
flavor: 'WordPressJalapeno',
152-
build_type: 'Debug',
151+
flavor: "WordPress#{INSTALLABLE_BUILD_FLAVOR}",
152+
build_type: INSTALLABLE_BUILD_TYPE,
153153
properties: { installableBuildVersionName: generate_installable_build_number }
154154
)
155155

@@ -170,8 +170,8 @@
170170

171171
gradle(
172172
task: 'assemble',
173-
flavor: 'JetpackJalapeno',
174-
build_type: 'Debug',
173+
flavor: "Jetpack#{INSTALLABLE_BUILD_FLAVOR}",
174+
build_type: INSTALLABLE_BUILD_TYPE,
175175
properties: { installableBuildVersionName: generate_installable_build_number }
176176
)
177177

@@ -259,7 +259,22 @@ def upload_installable_build(product:)
259259

260260
install_url = "#{INSTALLABLE_BUILD_DOMAIN}/#{upload_path}"
261261
qr_code_url = "https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=#{CGI.escape(install_url)}&choe=UTF-8"
262-
comment_body = "You can test the #{product} changes on this Pull Request by <a href='#{install_url}'>downloading an installable build (#{filename})</a>, or scanning this QR code:<br><a href='#{install_url}'><img src='#{qr_code_url}' width='250' height='250' /></a>"
262+
icon = "<img alt='#{product}' align='top' src='https://raw.githubusercontent.com/buildkite/emojis/main/img-buildkite-64/#{product.downcase}.png' width='20px' />"
263+
comment_body = <<~PR_COMMENT
264+
<details>
265+
<summary>#{icon}📲 You can test these changes on #{product} by <a href='#{install_url}'>downloading <tt>#{filename}</tt></a></summary>
266+
<table><tr>
267+
<td width='250' rowspan='5'><a href='#{install_url}'><img src='#{qr_code_url}' width='250' height='250' /></a></td>
268+
<td colspan='2'>💡 Scan this QR code with your Android phone to download and install the APK directly on it.</td>
269+
</tr>
270+
<tr><td width='150px'><b>App</b></td><td><tt>#{product}</tt></td></tr>
271+
<tr><td><b>Build Flavor</b></td><td><tt>#{INSTALLABLE_BUILD_FLAVOR}</tt></td></tr>
272+
<tr><td><b>Build Type</b></td><td><tt>#{INSTALLABLE_BUILD_TYPE}</tt></td></tr>
273+
<tr><td><b>Commit</b></td><td>#{ENV['BUILDKITE_COMMIT']}</td></tr>
274+
</table>
275+
</details>
276+
<em>Note: This installable build uses the <tt>#{INSTALLABLE_BUILD_FLAVOR}#{INSTALLABLE_BUILD_TYPE}</tt> build flavor, and does not support Google Login.</em>
277+
PR_COMMENT
263278

264279
comment_on_pr(
265280
project: GHHELPER_REPO,

0 commit comments

Comments
 (0)