This action updates the Gradle URL, SHA256 checksum, and wrapper for your Android app.
It checks https://services.gradle.org/versions/all
for the current
Gradle version and SHA256 checksums and then essentially runs these
commands to update Gradle, performing a few additional checks as well:
# update URL and SHA256 in gradle-wrapper.properties
$ ./gradlew wrapper --gradle-version $VERSION --gradle-distribution-sha256-sum $SHA256SUM
# update gradle-wrapper.jar, gradlew, and gradlew.bat
$ ./gradlew wrapper
The location of gradle-wrapper.jar
.
Defaults to gradle/wrapper/gradle-wrapper.jar
.
The location of gradle-wrapper.properties
.
Defaults to gradle/wrapper/gradle-wrapper.properties
.
The location of the gradlew
script to run.
Defaults to ./gradlew
.
The gradle version.
The download URL.
The checksum for the download.
The checksum for the wrapper.
Put the following in .github/workflows/gradle-update.yml
:
jobs:
gradle-update:
runs-on: ubuntu-latest
name: Gradle update
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Gradle update
id: gradle-update
uses: obfusk/gradle-update-action@v2
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
title: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"
commit-message: "Update Gradle to ${{ steps.gradle-update.outputs.version }}"
branch-suffix: timestamp
on:
schedule:
- cron: '0 0 * * *'
GNU General Public License v3.0 or later