Build Android APK #7
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
name: Build Android APK | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup node 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Install dependencies | |
run: | | |
npm install | |
cd example | |
npm install | |
- name: Build APK | |
run: | | |
npm run prepack | |
cd example/android | |
./gradlew assembleRelease | |
mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk | |
ls | |
pwd | |
echo ${{ github.workspace }} | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release-${{ github.sha }}.apk | |
path: example/android/app-release-${{ github.sha }}.apk |