Commit Graph

11 Commits

Author SHA1 Message Date
Daz DeBoer
a0ee12f71e Extract caching logic into a separate gradle-actions-caching component (#885)
With this change, the caching functionality of `setup-gradle` and
`dependency-submission` is now provided by `gradle-actions-caching`, a
closed-source library distributed under our [Terms of
Use](https://gradle.com/legal/terms-of-use/). The rest of the action
implementation remains open source.

Using `setup-gradle` or `dependency-submission` with caching enabled
involves loading and using the `gradle-actions-caching` component,
requiring acceptance of the [Terms of
Use](https://gradle.com/legal/terms-of-use/). There are no functional
changes to caching provided by these actions: all workflows will
continue to function as before.

The non-caching aspects of action implementation remain open source. By
running these actions with caching disabled they can be used without
ever loading `gradle-actions-caching` or accepting the license terms.

Supporting the caching infrastructure in this project requires a
substantial engineering investment by Gradle Technologies, which we can
sustain thanks to Develocity, our commercial offering. Caching
technologies are a core part of the Develocity offering, and the caching
in `setup-gradle` fits squarely in that space.

This licensing change lets us continue to build advanced capabilities
that go beyond what we would offer as open source. Proper
production-ready Configuration Cache support will be the first
capability. Improving build performance for self-hosted runners will
follow.

We may introduce functionality restrictions in future updates. However,
caching functionality will remain free for public repositories.
We have a long-standing commitment to open source, as maintainers of
Gradle Build Tool, and by [sponsoring the open source
community](https://gradle.com/oss-sponsored-by-develocity/) with free
Develocity licenses. Public repositories are primarily used by open
source projects, and we remain committed to supporting them.

- Implementation of caching logic to save and restore Gradle User Home
content has been removed, replaced by the `gradle-actions-caching`
component.
- The `@actions/caching` library is still used to cache Gradle
distributions that are downloaded and provisioned by `setup-gradle`.
This PR updates to the latest version of `@actions/caching`, and removes
the patch that is no longer required.
- License notices are now displayed in documentation, logs and the
generated Job Summary.
2026-03-18 14:57:27 -06:00
Daz DeBoer
91619fae90 Attempt to use gradle wrapper for cache cleanup (#525)
The cache-cleanup operation works by executing Gradle on a dummy project
and a custom init-script. The version of Gradle used should be at least
as high as the newest version used to run a build.

Previously, if the Gradle version on PATH didn't meet this requirement,
the action would download and install the required Gradle version.

With this PR, the action will now use an existing Gradle wrapper
distribution if it meets the requirement. This avoids unnecessary
downloads of Gradle versions that are already present on the runner.

The logic is:
- Determine the newest version of Gradle that was executed during the
Job. This is the 'minimum version' for cache cleanup.
- Inspect the Gradle version on PATH and any detected wrapper scripts to
see if they meet the 'minimum version'.
- The first executable that is found to meet the requirements will be
used for cache-cleanup.
- If no executable is found that meets the requirements, attempt to
provision Gradle with the 'minimum version'.

Fixes #515
2025-01-24 10:06:51 -07:00
daz
edf9e3c8c7 Improve comparison of Gradle versions 2025-01-23 17:36:14 -07:00
daz
24aa9155d9 Fix minor typo in log message 2025-01-23 12:08:44 -07:00
Daz DeBoer
7e0f050645 Ensure minimum Gradle version for cache-cleanup (#364)
Instead of always installing and using the latest Gradle version for
cache cleanup, we now require at least Gradle 8.9.

This avoids downloading and installing Gradle if the version on PATH is
sufficient to perform cache cleanup.
2024-08-31 11:11:24 -06:00
Daz DeBoer
4b7cc6e174 Differentiate Gradle 8.1 from 8.10 when checking version (#358)
Fixes #359
2024-08-26 14:47:28 -06:00
daz
5d7c18409c Use pre-installed Gradle when version matches
By executing Gradle on the PATH, we can avoid downloading and installing
a Gradle version that is already available on the runner.

Fixes #270
2024-07-19 13:46:56 -06:00
daz
b175189376 Download and install Gradle distributions into tmpdir 2024-07-19 09:14:37 -06:00
daz
7e9e469530 Rename 'input-params' to 'configuration' 2024-04-09 15:08:54 -06:00
daz
92975d7f32 Allow a task name to be specified for dependency-submission
Fixes: #125
2024-04-09 08:46:20 -06:00
daz
3335c16182 Move execution-related code into subpackage 2024-04-08 14:04:29 -06:00