|
146 | 146 | lane :build_and_upload_wordpress_installable_build do |
147 | 147 | UI.user_error!("'BUILDKITE_ARTIFACTS_S3_BUCKET' must be defined as an environment variable.") unless ENV['BUILDKITE_ARTIFACTS_S3_BUCKET'] |
148 | 148 |
|
| 149 | + versionName = generate_installable_build_number |
149 | 150 | gradle( |
150 | 151 | task: 'assemble', |
151 | 152 | flavor: "WordPress#{INSTALLABLE_BUILD_FLAVOR}", |
152 | 153 | build_type: INSTALLABLE_BUILD_TYPE, |
153 | | - properties: { installableBuildVersionName: generate_installable_build_number } |
| 154 | + properties: { installableBuildVersionName: versionName } |
154 | 155 | ) |
155 | 156 |
|
156 | | - upload_installable_build(product: 'WordPress') |
| 157 | + upload_installable_build(product: 'WordPress', versionName: versionName) |
157 | 158 | end |
158 | 159 |
|
159 | 160 | ##################################################################################### |
|
168 | 169 | lane :build_and_upload_jetpack_installable_build do |
169 | 170 | UI.user_error!("'BUILDKITE_ARTIFACTS_S3_BUCKET' must be defined as an environment variable.") unless ENV['BUILDKITE_ARTIFACTS_S3_BUCKET'] |
170 | 171 |
|
| 172 | + versionName = generate_installable_build_number |
171 | 173 | gradle( |
172 | 174 | task: 'assemble', |
173 | 175 | flavor: "Jetpack#{INSTALLABLE_BUILD_FLAVOR}", |
174 | 176 | build_type: INSTALLABLE_BUILD_TYPE, |
175 | | - properties: { installableBuildVersionName: generate_installable_build_number } |
| 177 | + properties: { installableBuildVersionName: versionName } |
176 | 178 | ) |
177 | 179 |
|
178 | | - upload_installable_build(product: 'Jetpack') |
| 180 | + upload_installable_build(product: 'Jetpack', versionName: versionName) |
179 | 181 | end |
180 | 182 |
|
181 | 183 | ##################################################################################### |
|
246 | 248 | # |
247 | 249 | # @param [String] product the display name of the app to upload to S3. 'WordPress' or 'Jetpack' |
248 | 250 | # |
249 | | - def upload_installable_build(product:) |
| 251 | + def upload_installable_build(product:, versionName:) |
250 | 252 | filename = "#{product.downcase}-installable-build-#{generate_installable_build_number}.apk" |
251 | 253 |
|
252 | 254 | upload_path = upload_to_s3( |
@@ -278,6 +280,7 @@ def upload_installable_build(product:) |
278 | 280 | if ENV['BUILDKITE'] |
279 | 281 | message = "#{product} Installable Build: [#{filename}](#{install_url})" |
280 | 282 | buildkite_annotate(style: 'info', context: "installable-build-#{product}", message: message) |
| 283 | + buildkite_metadata(set: { versionName: versionName, 'build:flavor': INSTALLABLE_BUILD_FLAVOR, 'build:type': INSTALLABLE_BUILD_TYPE }) |
281 | 284 | end |
282 | 285 | end |
283 | 286 |
|
|
0 commit comments