diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml new file mode 100644 index 000000000..9730e2e81 --- /dev/null +++ b/.github/workflows/android-build.yml @@ -0,0 +1,46 @@ +name: Build Android APK + +on: + workflow_dispatch: + push: + branches: [main] + paths: + - 'android/**' + - '.github/workflows/android-build.yml' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Write google-services.json + run: | + echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > android/app/google-services.json + echo "google-services.json written:" + head -5 android/app/google-services.json + + - name: Grant execute permission for gradlew + working-directory: android + run: chmod +x gradlew + + - name: Build Debug APK + working-directory: android + run: ./gradlew assembleDebug --no-daemon + + - name: Upload APK artifact + uses: actions/upload-artifact@v4 + with: + name: httpsms-debug-apk + path: android/app/build/outputs/apk/debug/*.apk + retention-days: 30