diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index addb3b5..c9f8d7d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -3,6 +3,7 @@ name: Android CI on: push: branches: [ "deploy" ] + workflow_dispatch: jobs: build: @@ -23,3 +24,50 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build + +--------- + +name: Android Release Build + +on: + push: + branches: + - deploy + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout Code + uses: actions/checkout@v4 + + # Set up JDK 11 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + # Create local.properties file dynamically + - name: Create local.properties + run: | + echo "google-web-client-id=${{ secrets.GOOGLE_WEB_CLIENT_ID }}" > local.properties + echo "sdk.dir=${{ env.ANDROID_SDK_ROOT }}" >> local.properties + + # Grant execute permission for gradlew + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + # Build the APK with Gradle (Release build) + - name: Build APK (Release) + run: ./gradlew assembleRelease + + # Upload the APK as an artifact (optional) + - name: Upload APK artifact + uses: actions/upload-artifact@v3 + with: + name: app-release-apk + path: app/build/outputs/apk/release/app-release-by-action.apk