From f881c3633a9b7ba86e0b21482bf7984876b0df41 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Thu, 11 Mar 2021 22:04:13 +0800 Subject: [PATCH] [CI] Add build cache (#334) --- .github/workflows/core.yml | 14 +++++++++++++- .github/workflows/manager.yml | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index ea4e128c..603470f3 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -36,8 +36,20 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + - name: Cache Gradle + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ hashFiles('**/*.gradle.kts') }} + restore-keys: gradle- - name: Build with Gradle - run: bash ./gradlew zipRelease zipDebug + run: | + echo 'org.gradle.caching=true' >> gradle.properties + echo 'org.gradle.parallel=true' >> gradle.properties + echo 'org.gradle.vfs.watch=true' >> gradle.properties + ./gradlew zipRelease zipDebug - name: Prepare artifact if: success() id: prepareArtifact diff --git a/.github/workflows/manager.yml b/.github/workflows/manager.yml index e0a2a0c2..51ab9918 100644 --- a/.github/workflows/manager.yml +++ b/.github/workflows/manager.yml @@ -35,9 +35,20 @@ jobs: echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties echo androidStoreFile='key.jks' >> gradle.properties echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks + - name: Cache Gradle + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ hashFiles('**/*.gradle.kts') }} + restore-keys: gradle- - name: Build with Gradle id: buildRelease run: | + echo 'org.gradle.caching=true' >> gradle.properties + echo 'org.gradle.parallel=true' >> gradle.properties + echo 'org.gradle.vfs.watch=true' >> gradle.properties ./gradlew :app:assembleRelease echo "::set-output name=releaseName::`ls app/build/outputs/apk/release/LSPosed*-v*-release.apk | awk -F '(/|.apk)' '{print $6}'`" - name: Upload apk