Update build.yml #2
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: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install Expo CLI | |
| run: npm install -g expo-cli @expo/ngrok | |
| - name: Prebuild Android | |
| run: npx expo prebuild --platform android --clean --no-install | |
| - name: Make gradlew executable | |
| run: chmod +x android/gradlew | |
| - name: Build APK | |
| run: | | |
| cd android | |
| ./gradlew assembleRelease --no-daemon | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TaskManagerPlus-APK | |
| path: android/app/build/outputs/apk/release/app-release.apk | |
| retention-days: 30 |