Update docs for v6

This commit is contained in:
Daz DeBoer
2026-04-03 15:21:48 -06:00
parent 50e97c2cd7
commit 11d4d83c63
8 changed files with 46 additions and 43 deletions
+24 -21
View File
@@ -9,7 +9,7 @@ This GitHub Action can be used to configure Gradle for optimal execution on any
> **Prefer a 100% Open Source (MIT) path?**
> We also provide a **Basic Caching** provider as a thin wrapper over `actions/cache`. This provider is **free for all repositories** (public and private) and can be enabled at any time by setting `cache-provider: basic`.
>
> For a full breakdown of the components, usage tiers, and our **Safe Harbor** data privacy commitment, see our [Distribution & Licensing Guide](./DISTRIBUTION.md).
> For a full breakdown of the components, usage tiers, and our **Safe Harbor** data privacy commitment, see our [Distribution & Licensing Guide](../DISTRIBUTION.md).
## Why use the `setup-gradle` action?
@@ -55,7 +55,7 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
- name: Execute Gradle build
run: ./gradlew build
@@ -68,7 +68,7 @@ Downloaded Gradle versions are stored in the GitHub Actions cache, to avoid havi
```yaml
- name: Setup Gradle 8.10
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
gradle-version: '8.10' # Quotes required to prevent YAML converting to number
- name: Build with Gradle 8.10
@@ -106,7 +106,7 @@ jobs:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v5
- uses: gradle/actions/setup-gradle@v6
id: setup-gradle
with:
gradle-version: release-candidate
@@ -135,8 +135,11 @@ You choose which provider to use via the `cache-provider` input:
- **`basic`**: A fully open-source (MIT) caching implementation built on the standard GitHub Actions cache (`@actions/cache`). Uses the same caching strategy as `actions/setup-java` with `cache: gradle`. See [Basic Caching](#basic-caching) for details.
```yaml
# Use the open-source basic cache provider
cache-provider: basic
# Use the open-source basic cache provider
- uses: gradle/actions/setup-gradle@v6
id: setup-gradle
with:
cache-provider: basic
```
### Common cache configuration
@@ -538,7 +541,7 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
add-job-summary-as-pr-comment: 'on-failure' # Valid values are 'never' (default), 'always', and 'on-failure'
@@ -575,7 +578,7 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
- name: Run build with Gradle wrapper
run: ./gradlew build --scan
@@ -606,7 +609,7 @@ If you do not want wrapper-validation to occur automatically, you can disable it
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
validate-wrappers: false
```
@@ -618,7 +621,7 @@ These are not allowed by default.
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
validate-wrappers: true
allow-snapshot-wrappers: true
@@ -683,7 +686,7 @@ jobs:
java-version: 17
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
dependency-graph: generate-and-submit
- name: Run the usual CI build (dependency-graph will be generated and submitted post-job)
@@ -710,7 +713,7 @@ graph cannot be generated or submitted. You can enable this behavior with the `d
```yaml
# Ensure that the workflow Job will fail if the dependency graph cannot be submitted
- uses: gradle/actions/setup-gradle@v5
- uses: gradle/actions/setup-gradle@v6
with:
dependency-graph: generate-and-submit
dependency-graph-continue-on-failure: false
@@ -735,7 +738,7 @@ jobs:
java-version: 17
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
dependency-graph: generate-and-submit
- name: Run a build, resolving the 'dependency-graph' plugin from the plugin portal proxy
@@ -765,7 +768,7 @@ jobs:
java-version: 17
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
dependency-graph: generate-and-submit
- name: Build the app, generating a graph of dependencies required
@@ -809,7 +812,7 @@ To publish to https://scans.gradle.com, you must specify in your workflow that y
```yaml
- name: Setup Gradle to publish build scans
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
build-scan-publish: true
build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
@@ -831,7 +834,7 @@ The short-lived access token will then be used wherever a Develocity access key
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }} # Long-lived access key, visiblility is restricted to this step.
@@ -849,7 +852,7 @@ To avoid this, use the `develocity-token-expiry` parameter to specify a differen
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
develocity-token-expiry: '8' # The number of hours that the access token should remain valid (max 24).
@@ -871,7 +874,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
# The build will automatically use a short-lived access token to authenticate with Develocity
- name: Run a Gradle build that is configured to publish to Develocity.
@@ -903,7 +906,7 @@ Here's a minimal example:
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
develocity-injection-enabled: true
develocity-url: 'https://develocity.your-server.com'
@@ -920,7 +923,7 @@ In the likely scenario that your Develocity server requires authentication, you
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
with:
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
@@ -971,7 +974,7 @@ Here's an example using the env vars:
```yaml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
uses: gradle/actions/setup-gradle@v6
- name: Run a Gradle build with Develocity injection enabled with environment variables
run: ./gradlew build