From f744cbc1021fa066241fc011c45255d3f8b7ba28 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Tue, 30 Jan 2024 00:08:39 +0100 Subject: [PATCH] chore: Migrate from gradle-build-action to setup-gradle (#394) gradle-build-action is deprecated, setup-gradle replaces it. Enable the new support for the configuration cache. --- .github/workflows/ci.yml | 6 +++--- .github/workflows/ktlint.yml | 5 +++-- .github/workflows/populate-gradle-build-cache.yml | 5 +++-- .github/workflows/upload-blue-release-google-play.yml | 6 +++--- .github/workflows/upload-orange-release-google-play.yml | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2fc622dc..6defb1b21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,10 +30,10 @@ jobs: - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - name: Gradle Build Action - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' }} + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: ktlint run: ./gradlew clean ktlintCheck diff --git a/.github/workflows/ktlint.yml b/.github/workflows/ktlint.yml index bdbf1a52e..ffc2a4175 100644 --- a/.github/workflows/ktlint.yml +++ b/.github/workflows/ktlint.yml @@ -22,9 +22,10 @@ jobs: - uses: gradle/wrapper-validation-action@v1 - - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' }} + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - run: chmod +x ./gradlew diff --git a/.github/workflows/populate-gradle-build-cache.yml b/.github/workflows/populate-gradle-build-cache.yml index 4e02cc402..7bd154b42 100644 --- a/.github/workflows/populate-gradle-build-cache.yml +++ b/.github/workflows/populate-gradle-build-cache.yml @@ -30,9 +30,10 @@ jobs: - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' }} + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Run app:buildOrangeDebug run: ./gradlew app:build${{ matrix.color }}${{ matrix.store }}Debug diff --git a/.github/workflows/upload-blue-release-google-play.yml b/.github/workflows/upload-blue-release-google-play.yml index 4fe1544d4..eea376026 100644 --- a/.github/workflows/upload-blue-release-google-play.yml +++ b/.github/workflows/upload-blue-release-google-play.yml @@ -22,10 +22,10 @@ jobs: - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - name: Gradle Build Action - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' }} + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Build GitHub APK run: ./gradlew assembleBlueGithubRelease --stacktrace diff --git a/.github/workflows/upload-orange-release-google-play.yml b/.github/workflows/upload-orange-release-google-play.yml index d815d79f1..bf2e0bd69 100644 --- a/.github/workflows/upload-orange-release-google-play.yml +++ b/.github/workflows/upload-orange-release-google-play.yml @@ -24,10 +24,10 @@ jobs: - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - name: Gradle Build Action - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' }} + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Test run: ./gradlew app:testOrangeGoogleReleaseUnitTest --stacktrace