Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 78 additions & 10 deletions .github/workflows/latest-jdk-versions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Daily report of the exact JDK version each distribution currently resolves
# for every major from Java 6 through the newest GA release, and `latest`, on every operating
# system and architecture setup-java supports for it. Versions are resolved
# from vendor metadata only; no JDK is downloaded.
# from vendor metadata only; no JDK is downloaded. Compare main and the latest
# v6/v5 tags using each revision's own installers and locked dependencies.
name: Latest JDK versions report

on:
Expand All @@ -16,6 +17,8 @@ on:
pull_request:
paths:
- 'src/reports/**'
- 'scripts/build-report-resolver.mjs'
- '__tests__/latest-versions-report.test.ts'
- '.github/workflows/latest-jdk-versions.yml'

permissions:
Expand Down Expand Up @@ -54,14 +57,56 @@ jobs:
path: lib/latest-versions-report/
retention-days: 1

build-resolvers:
name: Build resolver (${{ matrix.setup-java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
steps:
- name: Checkout report tooling
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Checkout setup-java revision
uses: actions/checkout@v7
with:
repository: actions/setup-java
ref: ${{ matrix.setup-java }}
path: resolver-source
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
cache: npm
cache-dependency-path: resolver-source/package-lock.json
- name: Install revision dependencies
working-directory: resolver-source
run: npm ci
- name: Bundle revision metadata resolver
run: node scripts/build-report-resolver.mjs resolver-source "$SETUP_JAVA_REF" resolver
env:
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload revision metadata resolver
uses: actions/upload-artifact@v7
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver/
retention-days: 1

resolve:
name: Resolve versions (${{ matrix.platform }})
needs: build
name: Resolve versions (${{ matrix.setup-java }}, ${{ matrix.platform }})
needs: [build, build-resolvers]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
platform: [linux, macos, windows, solaris]
include:
- os: ubuntu-latest
platform: linux
Expand All @@ -82,27 +127,39 @@ jobs:
with:
name: latest-versions-report-tool
path: tool
- name: Download revision metadata resolver
uses: actions/download-artifact@v8
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver
- name: Resolve latest versions without downloading
run: node tool/index.js resolve "results/$REPORT_PLATFORM.json"
run: node tool/index.js resolve "results/$SETUP_JAVA_REF-$REPORT_PLATFORM.json"
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
REPORT_PLATFORM: ${{ matrix.platform }}
REPORT_RESOLVER: resolver
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-${{ matrix.platform }}
name: latest-jdk-versions-${{ matrix.setup-java }}-${{ matrix.platform }}
path: results/
retention-days: 1

# Installers pick musl builds on Alpine, which can resolve to other versions.
resolve-alpine:
name: Resolve versions (alpine)
needs: build
name: Resolve versions (${{ matrix.setup-java }}, alpine)
needs: [build, build-resolvers]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: node:24-alpine
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
defaults:
run:
shell: sh
Expand All @@ -112,21 +169,28 @@ jobs:
with:
name: latest-versions-report-tool
path: tool
- name: Download revision metadata resolver
uses: actions/download-artifact@v8
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver
- name: Resolve latest versions without downloading
run: node tool/index.js resolve results/alpine.json
run: node tool/index.js resolve "results/$SETUP_JAVA_REF-alpine.json"
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
REPORT_RESOLVER: resolver
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-alpine
name: latest-jdk-versions-${{ matrix.setup-java }}-alpine
path: results/
retention-days: 1

report:
name: Report
needs: [build, resolve, resolve-alpine]
needs: [build, build-resolvers, resolve, resolve-alpine]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
steps:
Expand All @@ -146,8 +210,12 @@ jobs:
path: results
merge-multiple: true
- name: Write report
if: ${{ !cancelled() }}
run: node tool/index.js summarize results latest-jdk-versions.md
env:
REPORT_REFS: main,v6,v5
- name: Upload report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-report
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ When `check-latest` is `false`, the action first tries the runner tool cache for

GitHub-hosted runners primarily pre-cache Eclipse Temurin JDKs. See the installed Java versions for [Ubuntu](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java), [Windows](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#java), and [macOS](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#java). On a fresh GitHub-hosted runner, requests for other distributions usually miss the tool cache and resolve from remote metadata. For broad version ranges such as a major version (`21`, `25`), this often behaves similarly to `check-latest: true` because the action downloads the latest available release that satisfies the range.

To see which exact version a request resolves to today, open the summary of the latest run of the daily [Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml) workflow. For every supported distribution, it lists the version that `setup-java` currently resolves from vendor metadata for every major from Java 6 through the newest stable GA release (including non-LTS releases), plus `latest`, on every operating system and architecture the action supports for that distribution, including Alpine Linux and Solaris. Because vendors publish builds per platform, the same request can resolve to different versions on different platforms. The report doesn't download any JDKs. Floating vendor URLs are marked when their exact version cannot be established from metadata alone. It shows what a job installs on a tool-cache miss or with `check-latest: true`.
To see which exact version a request resolves to today, open the summary of the latest run of the daily [Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml) workflow. It compares `setup-java@main`, the latest `setup-java@v6`, and the latest `setup-java@v5`, with separate sections and the exact commit checked for each. Each revision uses its own installers and locked dependencies to resolve vendor metadata for every major from Java 6 through the newest stable GA release (including non-LTS releases), plus `latest`, across its distributions, operating systems and architectures, including Alpine Linux and Solaris. Older revisions without capability maps probe all candidate architectures; unsupported combinations and version syntax (such as `latest` in v5) are marked `n/a`. Distribution support and resolved versions can differ between action revisions as well as platforms. Missing reports and lookup failures are shown explicitly. The report doesn't download any JDKs. Floating vendor URLs are marked when their exact version cannot be established from metadata alone. It shows what a job installs on a tool-cache miss or with `check-latest: true`.

The `latest-jdk-versions-report` artifact contains the full Markdown report and per-revision/platform JSON results. If the combined report exceeds GitHub's job-summary size limit, the summary shows an overview pointing to this artifact instead.

## Download integrity and signatures

Expand Down
Loading
Loading