Mobile app preparations - prototyping #2
Workflow file for this run
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: Android Build | |
| on: | |
| push: | |
| branches: [main, mobile-app] | |
| paths: | |
| - 'android/**' | |
| - '.github/workflows/android.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'android/**' | |
| - '.github/workflows/android.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: android | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| gradle-version: 8.5 | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle*', 'android/**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Build debug APK | |
| run: ./gradlew assembleDebug --no-daemon | |
| - name: Run unit tests | |
| run: ./gradlew testDebugUnitTest --no-daemon | |
| continue-on-error: true | |
| - name: Upload debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-debug | |
| path: android/app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 7 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| defaults: | |
| run: | |
| working-directory: android | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| gradle-version: 8.5 | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle*', 'android/**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Build release APK (unsigned) | |
| run: ./gradlew assembleRelease --no-daemon | |
| - name: Upload release APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-release-unsigned | |
| path: android/app/build/outputs/apk/release/app-release-unsigned.apk | |
| retention-days: 30 | |
| # Note: For actual Play Store deployment, you would need to: | |
| # 1. Set up signing keystore from secrets | |
| # 2. Sign the APK or build AAB | |
| # 3. Upload to Play Store using fastlane or Google Play Developer API | |
| - name: Release step placeholder | |
| run: | | |
| echo "Release step placeholder" | |
| echo "In production, this would:" | |
| echo "1. Decode signing keystore from secrets" | |
| echo "2. Sign the release APK or build signed AAB" | |
| echo "3. Upload to Google Play Console" |