Build Android APK #12
This file contains hidden or 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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - ".github/workflows/build-android-apk.yml" | |
| - "android-app/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-android-apk: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: android-app | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: android-app/package-lock.json | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android wrapper dependencies | |
| run: npm ci | |
| - name: Sync Capacitor assets | |
| run: npm run sync | |
| - name: Make Gradle wrapper executable | |
| working-directory: android-app/android | |
| run: chmod +x ./gradlew | |
| - name: Build debug APK | |
| working-directory: android-app/android | |
| run: ./gradlew assembleDebug | |
| - name: Upload debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mha-widget-hub-debug-apk | |
| path: android-app/android/app/build/outputs/apk/debug/app-debug.apk | |
| if-no-files-found: error |