Enhance APK build workflow: add artifact upload step for generated APK #3
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 APK | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build-apk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma Client | |
| run: npm run db:generate | |
| - name: Run tests | |
| run: npm test | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Build Next.js app | |
| run: npm run build | |
| - name: Add Android platform | |
| run: npx cap add android | |
| - name: Build APK | |
| run: npx cap build android | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: chappi-apk-${{ github.ref_name }} | |
| path: android/app/build/outputs/apk/debug/app-debug.apk |