Centralize CI build JDK, update with Renovate (#1941)

This commit is contained in:
Jake Wharton
2025-02-27 13:51:13 -05:00
committed by GitHub
parent f40e79e3a9
commit cdc2c6b70f
4 changed files with 29 additions and 10 deletions

View File

@@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

26
.github/renovate.json5 vendored Normal file
View File

@@ -0,0 +1,26 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:recommended',
],
ignorePresets: [
// Ensure we get the latest version and are not pinned to old versions.
'workarounds:javaLTSVersions',
],
customManagers: [
// Update .java-version file with the latest JDK version.
{
customType: 'regex',
fileMatch: [
'\\.java-version$',
],
matchStrings: [
'(?<currentValue>.*)\\n',
],
datasourceTemplate: 'java-version',
depNameTemplate: 'java',
// Only write the major version.
extractVersionTemplate: '^(?<version>\\d+)',
},
]
}

1
.github/workflows/.java-version vendored Normal file
View File

@@ -0,0 +1 @@
21

View File

@@ -16,12 +16,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Configure JDK - uses: actions/setup-java@v4
uses: actions/setup-java@v4
with: with:
distribution: 'zulu' distribution: 'zulu'
java-version: '21' java-version-file: .github/workflows/.java-version
cache: 'gradle'
- name: Setup Gradle - name: Setup Gradle
uses: gradle/actions/setup-gradle@v4 uses: gradle/actions/setup-gradle@v4