Skip to content

Commit 7460bc5

Browse files
authored
Merge pull request #17024 from wordpress-mobile/release/20.5
Merge releaes/20.5 after some tooling improvements
2 parents 955a4ab + c2c2ae0 commit 7460bc5

12 files changed

Lines changed: 265 additions & 156 deletions

File tree

.buildkite/beta-builds.yml

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,52 @@ common_params:
88
- automattic/bash-cache#2.1.0
99

1010
steps:
11+
#################
12+
# Lint
13+
#################
14+
- group: "🕵️ Lint"
15+
steps:
1116

12-
- label: "Lint WordPress"
13-
command: ".buildkite/commands/lint.sh wordpress"
14-
key: wplint
15-
artifact_paths:
16-
- "**/build/reports/lint-results*.*"
17-
18-
# - label: "🔬 Lint Jetpack"
19-
# command: ".buildkite/commands/lint.sh jetpack"
20-
# key: jplint
21-
# artifact_paths:
22-
# - "**/build/reports/lint-results*.*"
23-
24-
- label: "🛠 WordPress Beta Build"
25-
command: ".buildkite/commands/beta-build.sh wordpress"
26-
depends_on: wplint
27-
plugins: *common_plugins
28-
notify:
29-
- slack: "#build-and-ship"
17+
- label: "🕵️ Lint WordPress"
18+
key: wplint
19+
command: ".buildkite/commands/lint.sh wordpress"
20+
artifact_paths:
21+
- "**/build/reports/lint-results*.*"
22+
23+
- label: "🕵️ Lint Jetpack"
24+
key: jplint
25+
command: ".buildkite/commands/lint.sh jetpack"
26+
artifact_paths:
27+
- "**/build/reports/lint-results*.*"
28+
29+
#################
30+
# Beta Builds
31+
#################
32+
- group: "🚀 Beta Builds"
33+
steps:
34+
35+
- label: "🛠 WordPress Beta Build"
36+
key: wpbuild
37+
command: ".buildkite/commands/beta-build.sh wordpress"
38+
depends_on: wplint
39+
plugins: *common_plugins
40+
notify:
41+
- slack: "#build-and-ship"
42+
43+
- label: "🛠 Jetpack Beta Build"
44+
key: jpbuild
45+
command: ".buildkite/commands/beta-build.sh jetpack"
46+
depends_on: jplint
47+
plugins: *common_plugins
48+
notify:
49+
- slack: "#build-and-ship"
3050

31-
- label: "🛠 Jetpack Beta Build"
32-
command: ".buildkite/commands/beta-build.sh jetpack"
33-
# depends_on: jplint
51+
#################
52+
# GitHub Release
53+
#################
54+
- label: ":github: Release"
55+
depends_on:
56+
- wpbuild
57+
- jpbuild
58+
command: ".buildkite/commands/create-github-release.sh"
3459
plugins: *common_plugins
35-
notify:
36-
- slack: "#build-and-ship"

.buildkite/commands/beta-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ bundle exec fastlane run configure_apply
88

99
echo "--- :hammer_and_wrench: Building"
1010
bundle exec fastlane build_beta app:$1 skip_confirm:true skip_prechecks:true upload_to_play_store:true
11+
12+
echo "--- 💾 Saving Artifact"
13+
for aab in build/*.aab; do
14+
buildkite-agent artifact upload "$aab"
15+
echo "<a href="artifact://$aab">$(basename "$aab")</a>" | buildkite-agent annotate --style info --context "beta-build-$aab"
16+
done
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -eu
2+
3+
echo "--- :rubygems: Setting up Gems"
4+
install_gems
5+
6+
echo "--- ⬇️ Downloading AAB Artefacts"
7+
mkdir -p build/
8+
buildkite-agent artifact download "*.aab" build/
9+
10+
echo "--- :github: Create GitHub Release"
11+
bundle exec fastlane create_gh_release

.buildkite/commands/release-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ bundle exec fastlane run configure_apply
88

99
echo "--- :hammer_and_wrench: Building"
1010
bundle exec fastlane build_and_upload_release app:$1 skip_confirm:true skip_prechecks:true upload_to_play_store:true
11+
12+
echo "--- 💾 Saving Artifact"
13+
for aab in build/*.aab; do
14+
buildkite-agent artifact upload "$aab"
15+
echo "<a href="artifact://$aab">$(basename "$aab")</a>" | buildkite-agent annotate --style info --context "release-build-$aab"
16+
done

.buildkite/pipeline.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ steps:
1010
#################
1111
- group: "🕵️‍♂️ Linters"
1212
steps:
13-
- label: "checkstyle"
13+
- label: "🕵️ checkstyle"
1414
command: |
1515
cp gradle.properties-example gradle.properties
1616
./gradlew checkstyle
1717
plugins: *common_plugins
1818
artifact_paths:
1919
- "**/build/reports/checkstyle/checkstyle.*"
2020

21-
- label: "detekt"
21+
- label: "🕵️ detekt"
2222
command: |
2323
cp gradle.properties-example gradle.properties
2424
./gradlew detekt
2525
plugins: *common_plugins
2626
artifact_paths:
2727
- "**/build/reports/detekt/detekt.html"
2828

29-
- label: "Lint WordPress"
29+
- label: "🕵️ Lint WordPress"
3030
command: ".buildkite/commands/lint.sh wordpress"
3131
artifact_paths:
3232
- "**/build/reports/lint-results*.*"
3333

34-
# - label: "Lint Jetpack"
35-
# command: ".buildkite/commands/lint.sh jetpack"
36-
# artifact_paths:
37-
# - "**/build/reports/lint-results*.*"
34+
- label: "🕵️ Lint Jetpack"
35+
command: ".buildkite/commands/lint.sh jetpack"
36+
artifact_paths:
37+
- "**/build/reports/lint-results*.*"
3838

3939
- label: "Dependency Tree Diff"
4040
command: |
@@ -48,19 +48,19 @@ steps:
4848
#################
4949
- group: "🔬 Unit Tests"
5050
steps:
51-
- label: "Test WordPress"
51+
- label: "🔬 Test WordPress"
5252
command: |
5353
cp gradle.properties-example gradle.properties
5454
./gradlew testWordpressVanillaRelease
5555
plugins: *common_plugins
5656

57-
- label: "Test Processors"
57+
- label: "🔬 Test Processors"
5858
command: |
5959
cp gradle.properties-example gradle.properties
6060
./gradlew :libs:processors:test
6161
plugins: *common_plugins
6262

63-
- label: "Test Image Editor"
63+
- label: "🔬 Test Image Editor"
6464
command: |
6565
cp gradle.properties-example gradle.properties
6666
./gradlew :libs:image-editor:test

.buildkite/release-builds.yml

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,52 @@ common_params:
88
- automattic/bash-cache#2.1.0
99

1010
steps:
11+
#################
12+
# Lint
13+
#################
14+
- group: "🕵️ Lint"
15+
steps:
1116

12-
- label: "Lint WordPress"
13-
command: ".buildkite/commands/lint.sh wordpress"
14-
key: wplint
15-
artifact_paths:
16-
- "**/build/reports/lint-results*.*"
17-
18-
# - label: "🔬 Lint Jetpack"
19-
# command: ".buildkite/commands/lint.sh jetpack"
20-
# key: jplint
21-
# artifact_paths:
22-
# - "**/build/reports/lint-results*.*"
23-
24-
- label: "🛠 WordPress Release Build"
25-
command: ".buildkite/commands/release-build.sh wordpress"
26-
depends_on: wplint
27-
plugins: *common_plugins
28-
notify:
29-
- slack: "#build-and-ship"
17+
- label: "🕵️ Lint WordPress"
18+
key: wplint
19+
command: ".buildkite/commands/lint.sh wordpress"
20+
artifact_paths:
21+
- "**/build/reports/lint-results*.*"
3022

31-
- label: "🛠 Jetpack Release Build"
32-
command: ".buildkite/commands/release-build.sh jetpack"
33-
# depends_on: jplint
34-
plugins: *common_plugins
35-
notify:
36-
- slack: "#build-and-ship"
23+
- label: "🕵️ Lint Jetpack"
24+
key: jplint
25+
command: ".buildkite/commands/lint.sh jetpack"
26+
artifact_paths:
27+
- "**/build/reports/lint-results*.*"
28+
29+
#################
30+
# Beta Builds
31+
#################
32+
- group: "🚀 Beta Builds"
33+
steps:
3734

35+
- label: "🛠 WordPress Release Build"
36+
key: wpbuild
37+
command: ".buildkite/commands/release-build.sh wordpress"
38+
depends_on: wplint
39+
plugins: *common_plugins
40+
notify:
41+
- slack: "#build-and-ship"
42+
43+
- label: "🛠 Jetpack Release Build"
44+
key: jpbuild
45+
command: ".buildkite/commands/release-build.sh jetpack"
46+
depends_on: jplint
47+
plugins: *common_plugins
48+
notify:
49+
- slack: "#build-and-ship"
50+
51+
#################
52+
# GitHub Release
53+
#################
54+
- label: ":github: Release"
55+
depends_on:
56+
- wpbuild
57+
- jpbuild
58+
command: ".buildkite/commands/create-github-release.sh"
59+
plugins: *common_plugins

WordPress/build.gradle

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ android {
7070

7171
compileSdkVersion rootProject.compileSdkVersion
7272

73+
def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties"))
74+
7375
defaultConfig {
7476
applicationId "org.wordpress.android"
7577
archivesBaseName = "$applicationId"
7678

79+
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("versionName")
80+
versionCode versionProperties.getProperty("versionCode").toInteger()
81+
7782
minSdkVersion rootProject.minSdkVersion
7883
targetSdkVersion rootProject.targetSdkVersion
7984

@@ -141,8 +146,6 @@ android {
141146

142147
flavorDimensions "app", "buildType"
143148

144-
def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properties"))
145-
146149
productFlavors {
147150
wordpress {
148151
isDefault true
@@ -184,46 +187,25 @@ android {
184187
vanilla {
185188
dimension "buildType"
186189

187-
versionName versionProperties.getProperty("versionName")
188-
versionCode versionProperties.getProperty("versionCode").toInteger()
189-
190190
buildConfigField "boolean", "ME_ACTIVITY_AVAILABLE", "false"
191191
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
192192
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false"
193193
}
194194

195-
// Used for Alpha builds - testing builds with experimental features enabled.
196-
// AppName: WordPress/Jetpack
197-
zalpha {
198-
dimension "buildType"
199-
200-
versionName versionProperties.getProperty("alpha.versionName")
201-
versionCode versionProperties.getProperty("alpha.versionCode").toInteger()
202-
203-
buildConfigField "boolean", "VIDEO_OPTIMIZATION_AVAILABLE", "true"
204-
buildConfigField "boolean", "ENABLE_DEBUG_SETTINGS", "false"
205-
}
206-
207195
// Used for local development - preferred variant for developers.
208196
// AppName: WordPress Beta/Jetpack Beta
209197
wasabi {
210198
applicationIdSuffix ".beta"
211199
dimension "buildType"
212-
213-
versionName versionProperties.getProperty("alpha.versionName")
214-
versionCode versionProperties.getProperty("alpha.versionCode").toInteger()
215200
}
216201

217-
// Used for CI builds on PRs (downloadable apks). Can be used locally when a developer needs
202+
// Used for CI builds on PRs (aka "Installable Builds"). Can be used locally when a developer needs
218203
// to install multiple versions of the app on the same device.
219204
// AppName: WordPress Pre-Alpha/Jetpack Pre-Alpha
220205
jalapeno {
221206
isDefault true
222207
applicationIdSuffix ".prealpha"
223208
dimension "buildType"
224-
225-
versionName project.findProperty("installableBuildVersionName") ?: versionProperties.getProperty("alpha.versionName")
226-
versionCode 1 // Fixed versionCode because those builds are not meant to be uploaded to the PlayStore.
227209
}
228210

229211
// Also dynamically add additional `buildConfigFields` to our app flavors from any `wp.`/`jp.`-prefixed property in `gradle.properties`
@@ -605,19 +587,14 @@ tasks.register("dependencyTreeDiffCommentToGitHub", ViolationCommentsToGitHubTas
605587

606588
tasks.register("printVersionName") {
607589
doLast {
608-
if (project.hasProperty('alpha')) {
609-
println android.productFlavors.zalpha.versionName
610-
} else {
611-
println android.productFlavors.vanilla.versionName
612-
}
590+
println android.defaultConfig.versionName
613591
}
614592
}
615593

616594
tasks.register("printAllVersions") {
617595
doLast {
618596
android.applicationVariants.all { variant ->
619-
def apkData = variant.outputs*.apkData
620-
println "${variant.name}: ${apkData*.versionName} (${apkData*.versionCode})"
597+
println "${variant.name}: ${variant.versionName} (${variant.versionCode})"
621598
}
622599
}
623600
}

0 commit comments

Comments
 (0)