2024-01-26 12:43:38 -05:00
> [!IMPORTANT]
> As of `v3` this action has been superceded by `gradle/actions/setup-gradle`.
> Any workflow that uses `gradle/gradle-build-action@v3` will transparently delegate to `gradle/actions/setup-gradle@v3`.
>
> Users are encouraged to update their workflows, replacing:
> ```
> uses: gradle/gradle-build-action@v3
> ```
>
> with
> ```
> uses: gradle/actions/setup-gradle@v3
> ```
>
2024-01-31 08:56:26 -05:00
> See the [setup-gradle documentation](https://github.com/gradle/actions/tree/main/setup-gradle) for up-to-date documentation for `gradle/actions/setup-gradle`.
2024-01-26 12:43:38 -05:00
2021-08-07 18:17:27 -04:00
# Execute Gradle builds in GitHub Actions workflows
2019-09-20 17:06:59 -04:00
2021-12-08 15:33:39 -05:00
This GitHub Action can be used to configure Gradle and optionally execute a Gradle build on any platform supported by GitHub Actions.
2019-09-20 17:06:59 -04:00
2024-02-13 15:42:19 -05:00
## Example usage
2019-09-23 06:56:08 -04:00
```yaml
2024-02-13 15:42:19 -05:00
name: Build
2024-01-01 15:48:08 -05:00
2024-02-13 15:42:19 -05:00
on: [ push ]
2023-08-20 18:27:48 -04:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-02-13 15:42:19 -05:00
- name: Checkout sources
uses: actions/checkout@v4
2023-08-20 18:27:48 -04:00
- name: Setup Gradle
2024-01-31 06:28:34 -05:00
uses: gradle/gradle-build-action@v3
2024-02-13 15:42:19 -05:00
- name: Build with Gradle
2023-08-20 18:27:48 -04:00
run: ./gradlew build
```
2024-02-13 15:42:19 -05:00
As of `v3` , the `gradle/gradle-build-action` action delegates to `gradle/actions/setup-gradle` with the same version.
Configuration and usage of these actions is identical for releases with the same version number.
2023-09-21 12:47:51 -04:00
2024-02-13 15:42:19 -05:00
See the [full setup-gradle documentation ](https://github.com/gradle/actions/tree/main/setup-gradle ) for more advanced usage scenarios.