Skip to content

Commit 9843b9e

Browse files
committed
chore: fix Android CI build
1 parent 41861aa commit 9843b9e

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,38 @@ jobs:
6666
cache-dependency-path: package-lock.json
6767
- name: Install node modules
6868
run: npm ci
69-
- name: Install JDK 1.8
70-
uses: actions/setup-java@v1
69+
- name: Install JDK
70+
uses: actions/setup-java@v2
7171
with:
72-
java-version: 1.8
72+
distribution: "zulu"
73+
java-version: "17"
74+
java-package: jdk
75+
- name: Ensure Android build-tools 33.0.2
76+
run: yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" "build-tools;33.0.2"
77+
- name: Install Gradle 7.6.1
78+
run: |
79+
set -euo pipefail
80+
GRADLE_VERSION=7.6.1
81+
curl -sSL "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -o gradle.zip
82+
unzip -q gradle.zip -d "$HOME/gradle"
83+
echo "$HOME/gradle/gradle-${GRADLE_VERSION}/bin" >> "$GITHUB_PATH"
84+
rm gradle.zip
7385
- name: Update test cert for httpbin.org
7486
run: npm run update:cert
75-
- name: Add workaround for missing DX files in build-tools 32 (https://stackoverflow.com/a/68430992)
76-
run: ln -s $ANDROID_HOME/build-tools/32.0.0/d8 $ANDROID_HOME/build-tools/32.0.0/dx && ln -s $ANDROID_HOME/build-tools/32.0.0/lib/d8.jar $ANDROID_HOME/build-tools/32.0.0/lib/dx.jar
87+
- name: Shim missing DX binaries (https://stackoverflow.com/a/68430992)
88+
run: |
89+
set -euo pipefail
90+
BUILD_TOOLS_PATH="$(ls -d $ANDROID_HOME/build-tools/*/ | sort -V | tail -n 1)"
91+
D8_BIN="${BUILD_TOOLS_PATH}d8"
92+
DX_BIN="${BUILD_TOOLS_PATH}dx"
93+
D8_JAR="${BUILD_TOOLS_PATH}lib/d8.jar"
94+
DX_JAR="${BUILD_TOOLS_PATH}lib/dx.jar"
95+
if [ -f "$D8_BIN" ] && [ ! -e "$DX_BIN" ]; then
96+
ln -s "$D8_BIN" "$DX_BIN"
97+
fi
98+
if [ -f "$D8_JAR" ] && [ ! -e "$DX_JAR" ]; then
99+
ln -s "$D8_JAR" "$DX_JAR"
100+
fi
77101
- name: Build test app
78102
run: scripts/build-test-app.sh --android --device
79103
- name: Upload artifact to BrowserStack

test/e2e-app-template/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"author": "Sefa Ilkimen",
1111
"license": "Apache-2.0",
1212
"dependencies": {
13-
"cordova": "11.0.0",
14-
"cordova-android": "10.1.1",
15-
"cordova-browser": "6.0.0",
16-
"cordova-ios": "6.2.0",
13+
"cordova": "12.0.0",
14+
"cordova-android": "12.0.1",
15+
"cordova-browser": "7.0.0",
16+
"cordova-ios": "7.1.1",
1717
"cordova-plugin-device": "2.0.3"
1818
},
1919
"cordova": {
@@ -26,4 +26,4 @@
2626
"cordova-plugin-device": {}
2727
}
2828
}
29-
}
29+
}

0 commit comments

Comments
 (0)