From 12646f81988a11aba61e96a192fbcbe0fa702fb5 Mon Sep 17 00:00:00 2001 From: daz Date: Mon, 1 Apr 2024 11:38:10 -0600 Subject: [PATCH] Clarify that Gradle Wrapper is assumed for examples --- README.md | 4 ++++ setup-gradle/README.md | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab0f1d8..a5cd15e 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,12 @@ This repository contains a set of GitHub Actions that are useful for building Gr ## The `setup-gradle` action +The `setup-gradle` action can be used to configure Gradle for optimal execution on any platform supported by GitHub Actions. + This replaces the previous `gradle/gradle-build-action`, which now delegates to this implementation. +The recommended way to execute any Gradle build is with the help of the [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html), and the examples assume that the Gradle Wrapper has been configured for the project. See [this example](setup-gradle/README.md#build-with-a-specific-gradle-version) if your project doesn't use the Gradle Wrapper. + ### Example usage ```yaml diff --git a/setup-gradle/README.md b/setup-gradle/README.md index 6271758..31c00ac 100644 --- a/setup-gradle/README.md +++ b/setup-gradle/README.md @@ -22,6 +22,8 @@ These features work both when Gradle is executed via `setup-gradle` and for any The `setup-gradle` action works by configuring environment variables and by adding a set of Gradle init-scripts to the Gradle User Home. These will apply to all Gradle executions on the runner, no matter how Gradle is invoked. This means that if you have an existing workflow that executes Gradle with a `run` step, you can add an initial "Setup Gradle" Step to benefit from caching, build-scan capture, and other features of this action. +The recommended way to execute any Gradle build is with the help of the [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html), and the following examples assume that the Gradle Wrapper has been configured for the project. See [this example](#build-with-a-specific-gradle-version) if your project doesn't use the Gradle Wrapper. + ```yaml name: Run Gradle on every push @@ -46,15 +48,18 @@ jobs: run: ./gradlew build ``` -## Choose a specific Gradle version +## Build with a specific Gradle version The `setup-gradle` action can download and install a specified Gradle version, adding this installed version to the PATH. Downloaded Gradle versions are stored in the GitHub Actions cache, to avoid having to download them again later. ```yaml - - uses: gradle/actions/setup-gradle@v3 + - name: Setup Gradle 8.5 + uses: gradle/actions/setup-gradle@v3 with: - gradle-version: 6.5 + gradle-version: 8.5 + - name: Build with Gradle 8.5 + run: gradle build ``` The `gradle-version` parameter can be set to any valid Gradle version.