Upgradle to latest wrapper #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upgradle to latest wrapper | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
upgradle-latest-wrapper: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: bot/upgradle-to-latest-wrapper | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Updadle to latest nightly and push to bot/upgradle-to-latest-wrapper | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git reset origin/master --hard | |
./gradlew wrapper --gradle-version=nightly | |
if ! git diff --quiet; then | |
./gradlew -v | |
VERSION=$(./gradlew -v | grep "Gradle" | cut -d' ' -f2) | |
git add . | |
git commit -m "Update Gradle wrapper to $VERSION" | |
git push --force origin bot/upgradle-to-latest-wrapper | |
else | |
echo "No changes to commit" | |
fi |