From a6ba1c05a1e59ea15a926e59b4801e016440eef2 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Tue, 14 Jan 2025 19:15:20 +0500 Subject: [PATCH] added support for caching generated apks --- .github/workflows/build.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6859c534d..024d00ea86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,14 +76,14 @@ jobs: uses: android-actions/setup-android@v3 with: cmdline-tools-version: 11479570 - # - uses: actions/cache@v3 - # with: - # path: | - # ~/.gradle/caches - # ~/.gradle/wrapper - # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - # restore-keys: | - # ${{ runner.os }}-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: Setup Gradle uses: gradle/actions/setup-gradle@v3 - name: Create Google Services JSON File @@ -93,9 +93,14 @@ jobs: - name: Execute Gradle build run: | cd android - ./gradlew clean - rm -rf ~/.gradle/caches/* ./gradlew assembleRelease + - name: Cache generated APK + uses: actions/cache@v3 + with: + path: app/build/outputs/apk/ + key: apk-${{ runner.os }}-${{ github.sha }} + restore-keys: | + apk-${{ runner.os }}- - name: Upload application uses: actions/upload-artifact@v4 with: