From 462bfd4adf7468359d7d8cde575c2c6a118b24f0 Mon Sep 17 00:00:00 2001 From: wismna Date: Fri, 11 Jul 2025 11:25:41 -0400 Subject: [PATCH] Add Github actions --- .github/workflows/android.yaml | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/android.yaml diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml new file mode 100644 index 0000000..f9be0ab --- /dev/null +++ b/.github/workflows/android.yaml @@ -0,0 +1,71 @@ +name: Android CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +env: + BUILD_DIR: app/build/outputs/bundle/release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Replace tokens in build.gradle + run: | + sed -i 's/#{\(.*\)}/${{\1}}/g' app/build.gradle + + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build AAB + run: ./gradlew bundleRelease + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: release-aab + path: ${{ env.BUILD_DIR }}/*release*.aab + + deploy-google-play: + needs: build + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: release-aab + path: release + + - name: Deploy to Google Play (production) + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} + packageName: com.wismna.geoffroy.donext + releaseFiles: release/app-release.aab + track: beta + metadataRootDirectory: fastlane/metadata/android + whatsNewDirectory: fastlane/metadata/android/en-US/changelogs + status: completed \ No newline at end of file