Skip to content

Commit 331e01a

Browse files
committed
chore: compile with JDK17 LTS, build with JDK21, update spotless, sonarcloud etc
1 parent 31f42ff commit 331e01a

File tree

7 files changed

+26
-22
lines changed

7 files changed

+26
-22
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
java-version: [ 8, 11, 17 ]
11+
java-version: [ 11, 17, 21 ]
1212
os: [ubuntu-latest, macos-latest, windows-latest]
1313
runs-on: ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Set up JDK
17-
uses: actions/setup-java@v3
17+
uses: actions/setup-java@v4
1818
with:
1919
java-version: ${{ matrix.java-version }}
2020
distribution: 'temurin'
2121
cache: 'gradle'
2222
- name: Validate Gradle wrapper
23-
uses: gradle/wrapper-validation-action@v1
23+
uses: gradle/actions/wrapper-validation@v3
2424
- name: Build with Gradle
25-
run: ./gradlew build
25+
run: ./gradlew build

.github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
check-tag:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Regex Match
1414
id: regex-match
1515
run: |
@@ -26,19 +26,19 @@ jobs:
2626
needs: [check-tag]
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
- name: Set up Java
31-
uses: actions/setup-java@v3
31+
uses: actions/setup-java@v4
3232
with:
33-
java-version: '8'
33+
java-version: '17'
3434
distribution: 'temurin'
3535
- name: Validate Gradle wrapper
36-
uses: gradle/wrapper-validation[email protected]
36+
uses: gradle/actions/wrapper-validation@v3
3737
# 发布项目
3838
- name: Publish
3939
run: ./gradlew publish
4040
env:
4141
SONATYPE_NEXUS_USERNAME: ${{secrets.SONATYPE_NEXUS_USERNAME}}
4242
SONATYPE_NEXUS_PASSWORD: ${{secrets.SONATYPE_NEXUS_PASSWORD}}
4343
SIGNING_KEY: ${{secrets.SIGNING_KEY}}
44-
SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}}
44+
SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}}

.github/workflows/sonarcloud-scan.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@ on:
99
- 'feat_*'
1010
- 'fix_*'
1111
- 'refactor_*'
12-
12+
1313
jobs:
1414
build:
1515
name: Build
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2121
- name: Set up JDK 17
22-
uses: actions/setup-java@v1
22+
uses: actions/setup-java@v4
2323
with:
2424
java-version: 17
25+
distribution: 'temurin'
2526
- name: Cache SonarCloud packages
26-
uses: actions/cache@v1
27+
uses: actions/cache@v4
2728
with:
2829
path: ~/.sonar/cache
2930
key: ${{ runner.os }}-sonar
3031
restore-keys: ${{ runner.os }}-sonar
3132
- name: Cache Gradle packages
32-
uses: actions/cache@v1
33+
uses: actions/cache@v4
3334
with:
3435
path: ~/.gradle/caches
3536
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}

buildSrc/src/main/groovy/common.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ plugins {
77
id "jacoco"
88
}
99

10+
sourceCompatibility = JavaVersion.VERSION_1_8
11+
targetCompatibility = JavaVersion.VERSION_1_8
12+
1013
version projectPropVersion
1114
group projectPropGroup
1215
compileJava.options.encoding = "UTF-8"
@@ -19,7 +22,7 @@ repositories {
1922
spotless {
2023
java {
2124
removeUnusedImports()
22-
googleJavaFormat('1.7')
25+
googleJavaFormat('1.22.0')
2326
}
2427
}
2528

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies {
2121
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
2222

2323
testImplementation "junit:junit:${junitVersion}"
24-
testImplementation "org.mockito:mockito-inline:${mockitoInlineVersion}"
24+
testImplementation "org.mockito:mockito-core:${mockitoCoreVersion}"
2525
testImplementation "com.squareup.okhttp3:mockwebserver:${okhttpVersion}"
2626
testImplementation "org.awaitility:awaitility:${awaitilityVersion}"
2727

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ junitVersion=4.13.2
66
junit5Version=5.9.1
77
okhttpVersion=4.10.0
88
gsonVersion=2.9.1
9-
mockitoInlineVersion=4.8.1
9+
mockitoCoreVersion=5.12.0
1010
awaitilityVersion=4.2.0
11-
spotlessVersion=6.11.0
11+
spotlessVersion=6.25.0
1212
shadowVersion=7.1.2
13-
sonarqubeVersion=4.0.0.2929
13+
sonarqubeVersion=5.0.0.4638
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)