Skip to content

Commit ee9e434

Browse files
committed
Update GitHub Actions Java version to Java 21 (from Java 17)
1 parent a90c9e2 commit ee9e434

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
# Use these Java versions
1717
java: [
18-
17, # Current Java LTS & minimum supported by Minecraft
18+
21, # Current Java LTS & minimum supported by Minecraft
1919
]
2020
# and run on both Linux and Windows
2121
# os: [ubuntu-20.04, windows-2022]
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/checkout@v3
3030

3131
- name: Setup JDK ${{ matrix.java }}
32-
uses: actions/setup-java@v3
32+
uses: actions/setup-java@v4
3333
with:
3434
distribution: temurin
3535
java-version: ${{ matrix.java }}
@@ -131,7 +131,7 @@ jobs:
131131
### Upload .jar artifacts ###
132132

133133
- name: Upload CommandAPI (Bukkit) plugin artifact
134-
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
134+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
135135
uses: actions/upload-artifact@v3
136136
with:
137137
name: CommandAPI (Bukkit plugin)
@@ -141,7 +141,7 @@ jobs:
141141
!commandapi-platforms/commandapi-bukkit/commandapi-bukkit-plugin/target/*javadoc.jar
142142
143143
- name: Upload CommandAPI (Velocity) plugin artifact
144-
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
144+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
145145
uses: actions/upload-artifact@v3
146146
with:
147147
name: CommandAPI (Velocity plugin)
@@ -157,10 +157,10 @@ jobs:
157157

158158
### Save PR information for 'SonarAnalyze'
159159
- name: Save PR number to file
160-
if: github.event_name == 'pull_request' && ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.java_version }} == '17'
160+
if: github.event_name == 'pull_request' && ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.java_version }} == '21'
161161
run: echo ${{ github.event.number }} > PR_NUMBER.txt
162162
- name: Archive PR number
163-
if: github.event_name == 'pull_request' && ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.java_version }} == '17'
163+
if: github.event_name == 'pull_request' && ${{ matrix.os }} == 'ubuntu-latest' && ${{ matrix.java_version }} == '21'
164164
uses: actions/upload-artifact@v3
165165
with:
166166
name: PR_NUMBER
@@ -175,14 +175,14 @@ jobs:
175175
- name: Checkout the CommandAPI repository
176176
uses: actions/checkout@v3
177177

178-
- name: Setup JDK 17
179-
uses: actions/setup-java@v3
178+
- name: Setup JDK 21
179+
uses: actions/setup-java@v4
180180
with:
181181
distribution: temurin
182182
server-id: ossrh # Needs to match the id in the main pom.xml file
183183
server-username: MAVEN_USERNAME
184184
server-password: MAVEN_PASSWORD
185-
java-version: 17
185+
java-version: 21
186186
cache: maven
187187

188188
- name: Deploy snapshot version of the CommandAPI (Bukkit+Velocity) to the Sonatype snapshot repository

.github/workflows/sonar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ jobs:
6666
echo "PR targets $branchTarget"
6767
echo "sonar.branch.target=$branchTarget" >> $GITHUB_ENV
6868
69-
- name: Setup JDK 17
70-
uses: actions/setup-java@v3
69+
- name: Setup JDK 21
70+
uses: actions/setup-java@v4
7171
with:
7272
distribution: temurin
73-
java-version: 17
73+
java-version: 21
7474
cache: maven
7575

7676
- name: Cache SonarCloud packages

0 commit comments

Comments
 (0)