From fec42d9ba09670cf0aff15f917a644b6eb84d2e8 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 20 Sep 2023 22:55:07 +0200 Subject: [PATCH] refactor(GitHub): Setup Gradle only once Follow the recommendation from [1] and setup Gradle only once, with subsquent steps invoking Gradle directly with a `run` step. [1]: https://github.com/gradle/gradle-build-action/blob/main/README.md#use-the-action-to-setup-gradle Signed-off-by: Sebastian Schuberth --- .github/workflows/release.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a8322d527066..da87f8782cd98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,21 +28,19 @@ jobs: with: distribution: temurin java-version: 17 - - name: Publish to OSSRH + - name: Setup Gradle uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true + - name: Publish to OSSRH env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - with: - gradle-home-cache-cleanup: true - arguments: publishAllPublicationsToOSSRHRepository + run: ./gradlew publishAllPublicationsToOSSRHRepository - name: Build ORT Distributions - uses: gradle/gradle-build-action@v2 - with: - gradle-home-cache-cleanup: true - arguments: :cli:distZip :helper-cli:distZip + run: ./gradlew :cli:distZip :helper-cli:distZip - name: Create GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}