From 1a7126b68e2230364725ddd4c81ccb03394f6888 Mon Sep 17 00:00:00 2001 From: beerpsi <92439990+beerpiss@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:57:01 +0700 Subject: [PATCH] ci: Address deprecation in setup-gradle action (#853) * ci: Address deprecation in setup-gradle action * consistency --- .github/workflows/build_pull_request.yml | 34 +++++++++++++----------- .github/workflows/build_push.yml | 25 ++++++++--------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index 582861bca..2a3d68446 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -64,11 +64,12 @@ jobs: echo "isIndividualChanged=$isIndividualChanged" >> $GITHUB_OUTPUT echo "isMultisrcChanged=$isMultisrcChanged" >> $GITHUB_OUTPUT + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 + - name: Generate multisrc sources if: ${{ steps.parse-changed-files.outputs.isMultisrcChanged == '1' }} - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 - with: - arguments: :multisrc:generateExtensions + run: ./gradlew :multisrc:generateExtensions - name: Get number of modules run: | @@ -113,22 +114,21 @@ jobs: java-version: 17 distribution: temurin - - name: Generate sources from the multi-source library - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 - env: - CI_MODULE_GEN: "true" + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 with: - arguments: :multisrc:generateExtensions cache-read-only: true + - name: Generate sources from the multi-source library + env: + CI_MODULE_GEN: "true" + run: ./gradlew :multisrc:generateExtensions + - name: Build extensions (chunk ${{ matrix.chunk }}) - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 env: CI_MULTISRC: "true" CI_CHUNK_NUM: ${{ matrix.chunk }} - with: - arguments: assembleDebug - cache-read-only: true + run: ./gradlew assembleDebug build_individual: name: Build individual modules @@ -147,11 +147,13 @@ jobs: java-version: 17 distribution: temurin + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 + with: + cache-read-only: true + - name: Build extensions (chunk ${{ matrix.chunk }}) - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 env: CI_MULTISRC: "false" CI_CHUNK_NUM: ${{ matrix.chunk }} - with: - arguments: assembleDebug - cache-read-only: true + run: ./gradlew assembleDebug diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 4e83d8443..2e954f52c 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -37,10 +37,11 @@ jobs: java-version: 17 distribution: temurin + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 + - name: Generate multisrc sources - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 - with: - arguments: :multisrc:generateExtensions + run: ./gradlew :multisrc:generateExtensions - name: Get number of modules run: | @@ -88,23 +89,22 @@ jobs: run: | echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 + - name: Generate sources from the multi-source library - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 env: CI_MODULE_GEN: "true" - with: - arguments: :multisrc:generateExtensions + run: ./gradlew :multisrc:generateExtensions - name: Build extensions (chunk ${{ matrix.chunk }}) - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 env: CI_MULTISRC: "true" CI_CHUNK_NUM: ${{ matrix.chunk }} ALIAS: ${{ secrets.ALIAS }} KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - with: - arguments: assembleRelease + run: ./gradlew assembleRelease - name: Upload APKs (chunk ${{ matrix.chunk }}) uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4 @@ -137,16 +137,17 @@ jobs: run: | echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks + - name: Set up Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3 + - name: Build extensions (chunk ${{ matrix.chunk }}) - uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0-rc.1 env: CI_MULTISRC: "false" CI_CHUNK_NUM: ${{ matrix.chunk }} ALIAS: ${{ secrets.ALIAS }} KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - with: - arguments: assembleRelease + run: ./gradlew assembleRelease - name: Upload APKs (chunk ${{ matrix.chunk }}) uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4