mirror of
https://github.com/actions/setup-java.git
synced 2026-07-08 16:20:44 +03:00
dist: Migrate from Zulu Discovery API to Azul Metadata API (#1010)
* Use Azul metadata API * Document arm64 -> aarch64 mapping in README.md * Paginate through all available versions * Fix typo: win_aarhc4 * Only query for linux_glibc packages * Add Zulu CRaC package support to metadata migration Fold CRaC-related work into the Zulu metadata API migration by wiring crac_supported query handling, extending Zulu package docs, and updating installer tests for jdk+crac/jre+crac behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Harden Zulu metadata pagination with safety cap - Stop paginating on a short page to avoid an extra empty request - Guard against undefined results (not just null) - Cap iterations at 100 pages and warn if the limit is hit to prevent a runaway loop if the API misbehaves Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Preserve JDK build number from Azul Metadata API The Azul Metadata API returns java_version as a 3-element array (e.g. [17,0,7]) and reports the build number separately in openjdk_build_number. The migration mapped version directly from java_version, dropping the build and breaking exact-version lookups like 17.0.7+7 (e2e failure: "No matching version found for SemVer"). Add openjdk_build_number to IZuluVersions and append it to java_version before converting to semver so resolved versions retain the build (e.g. 17.0.7+7). Update the zulu test fixtures to mirror the real API shape (3-element java_version plus openjdk_build_number) so unit tests exercise the actual response format, and rebuild dist. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Bruno Borges <brborges@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+13
-13
@@ -41,7 +41,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -66,8 +66,8 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '21'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||
java-version: '25'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx, jre+fx, jdk+crac, or jre+crac) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -79,7 +79,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
@@ -92,7 +92,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'microsoft'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -107,7 +107,7 @@ uses: actions/setup-java@v5
|
||||
with:
|
||||
token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
||||
distribution: 'microsoft'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
```
|
||||
|
||||
If the runner is not able to access github.com, any Java versions requested during a workflow run must come from the runner's tool cache. See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/enterprise-server@3.2/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)" for more information.
|
||||
@@ -121,7 +121,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -134,7 +134,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'oracle'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -159,7 +159,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'sapmachine'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -172,7 +172,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'graalvm'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
- run: |
|
||||
java --version
|
||||
native-image --version
|
||||
@@ -256,7 +256,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: '<distribution>'
|
||||
java-version: '11'
|
||||
java-version: '25'
|
||||
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
@@ -271,7 +271,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '21'
|
||||
java-version: '25'
|
||||
java-package: jdk+fx
|
||||
cache: maven
|
||||
- name: Build with Maven
|
||||
@@ -293,7 +293,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: '<distribution>'
|
||||
java-version: '11'
|
||||
java-version: '25'
|
||||
architecture: x86 # optional - default value derived from the runner machine
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user