Update README.md #164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: android | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
JAVA_HOME: /usr/lib/jvm/java-1.11.0-openjdk-amd64 | |
ANDROID_HOME: /usr/local/lib/android/sdk | |
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk | |
jobs: | |
android: | |
strategy: | |
matrix: | |
platform: [ubuntu-20.04] | |
node-version: [16] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Installing Java 11 | |
run: | | |
sudo apt update -y | |
sudo apt install openjdk-11-jdk openjdk-11-jre -y | |
- name: Forcing the use of Java 11 | |
run: | | |
java -version | |
sudo update-java-alternatives -l || echo OK | |
sudo update-java-alternatives -s $(sudo update-java-alternatives -l | grep '1\.11' | cut -d " " -f1) || echo OK | |
java -version | |
- name: Install Android SDK | |
run: | | |
sudo apt install android-sdk -y | |
- name: List installed SDKs | |
run: | | |
/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --version | |
/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --list_installed | |
- name: List SDK dir and cp D8s to DXs | |
run: | | |
ls -la /usr/local/lib/android/sdk/build-tools/ | |
cd /usr/local/lib/android/sdk/build-tools/ | |
for DIR in */; do | |
if [ -f "${DIR}d8" ]; then echo "copying ${DIR}d8 to ${DIR}dx"; cp ${DIR}d8 ${DIR}dx; fi | |
if [ -f "${DIR}lib/d8.jar" ]; then echo "copying ${DIR}lib/d8.jar to ${DIR}lib/dx.jar"; cp ${DIR}lib/d8.jar ${DIR}lib/dx.jar; fi | |
done | |
for DIR in */; do ls -l ${DIR}d*; done | |
- name: Install Gradle | |
run: sudo apt install gradle -y | |
- name: echo PATH | |
run: echo "${PATH//:/$'\n'}" | |
- name: Install Apache Cordova | |
run: npm install -g cordova | |
- name: Add Android Platform | |
run: | | |
rm -rf platforms/android | |
cordova platform add android | |
- run: cordova info | |
- run: npm test | |
- name: Building APK | |
run: cordova build android --release |