From efde3ae9e737a809f8f4e8554627decc99f58c06 Mon Sep 17 00:00:00 2001 From: JiY <79889934+Jiy-park@users.noreply.github.com> Date: Sun, 11 May 2025 18:57:57 +0900 Subject: [PATCH] Update android.yml --- .github/workflows/android.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) 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