Skip to content

Commit c6fe0dd

Browse files
yrodiereDavideD
authored andcommitted
Move to oracle-actions/setup-java to install newer JDKs
1 parent 6e790e4 commit c6fe0dd

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,17 @@ jobs:
136136
strategy:
137137
fail-fast: false
138138
matrix:
139-
# To list the available "feature versions" (ignore "tip_version", it's not relevant):
139+
# To list the available "feature versions" on adoptium.net (ignore "tip_version", it's not relevant):
140140
# https://api.adoptium.net/v3/info/available_releases
141-
# To list the available releases for a given "feature version" (example for 16):
141+
# To list the available releases for a given "feature version" on adoptium.net (example for 16):
142142
# https://api.adoptium.net/v3/assets/latest/16/hotspot
143+
# To see the available versions and download links on jdk.java.net:
144+
# https://github.com/oracle-actions/setup-java/blob/main/jdk.java.net-uri.properties
143145
java:
144146
- { name: "11", java_version_numeric: 11 }
145147
- { name: "17", java_version_numeric: 17 }
146-
- { name: "18", java_version_numeric: 18,
147-
download_url: "https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz" }
148-
- { name: "19-ea", java_version_numeric: 19,
149-
download_url: "https://download.java.net/java/early_access/jdk19/12/GPL/openjdk-19-ea+12_linux-x64_bin.tar.gz" }
148+
- { name: "18", java_version_numeric: 18, from: 'jdk.java.net' }
149+
- { name: "19-ea", java_version_numeric: 19, from: 'jdk.java.net' }
150150
steps:
151151
- uses: actions/checkout@v2
152152
- name: Get year/month for cache key
@@ -164,23 +164,18 @@ jobs:
164164
.gradle/wrapper
165165
# refresh cache every month to avoid unlimited growth
166166
key: gradle-java${{ matrix.java }}-${{ steps.get-date.outputs.yearmonth }}
167-
- name: Manually download JDK ${{ matrix.java.name }}
168-
if: matrix.java.download_url != ''
169-
run: wget -O $RUNNER_TEMP/java_package.tar.gz ${{ matrix.java.download_url }}
170-
- name: Set up JDK ${{ matrix.java.name }} (manually downloaded)
171-
if: matrix.java.download_url != ''
172-
uses: actions/[email protected]
167+
- name: Set up latest JDK ${{ matrix.java.name }} from jdk.java.net
168+
if: matrix.java.from == 'jdk.java.net'
169+
uses: oracle-actions/setup-java@v1
173170
with:
174-
distribution: 'jdkfile'
175-
jdkFile: ${{ runner.temp }}/java_package.tar.gz
176-
java-version: ${{ matrix.java.name }}
177-
architecture: x64
178-
- name: Set up JDK ${{ matrix.java.name }} (automatically downloaded)
179-
if: matrix.java.download_url == ''
171+
website: jdk.java.net
172+
release: ${{ matrix.java.java_version_numeric }}
173+
- name: Set up latest JDK ${{ matrix.java.name }} from Adoptium
174+
if: matrix.java.from == '' || matrix.java.from == 'adoptium.net'
180175
uses: actions/[email protected]
181176
with:
182177
distribution: 'temurin'
183-
java-version: ${{ matrix.java.name }}
178+
java-version: ${{ matrix.java.java_version_numeric }}
184179
check-latest: true
185180
- name: Export path to JDK ${{ matrix.java.name }}
186181
id: testjdk-exportpath

0 commit comments

Comments
 (0)