Update Dependencies #193
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: Update Dependencies | |
on: | |
schedule: | |
- cron: 0 0 * * 1 | |
env: | |
JAVA_VERSION: 17 | |
JAVA_PACKAGE: jdk | |
JAVA_ARCH: x64 | |
JAVA_DISTRO: temurin | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
java-package: ${{ env.JAVA_PACKAGE }} | |
architecture: ${{ env.JAVA_ARCH }} | |
distribution: ${{ env.JAVA_DISTRO }} | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Update gradle.lockfile | |
run: ./gradlew dependencies --write-locks | |
- name: Verify everything still works | |
run: ./gradlew build | |
- name: Cleanup Gradle Cache | |
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | |
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties | |
- name: Commit Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: ${{ github.actor }} | |
author_email: ${{ github.actor }}@users.noreply.github.com | |
message: Dependencies updated with './gradlew dependencies --write-locks' | |
add: gradle.lockfile | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |