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
157 changes: 157 additions & 0 deletions .github/workflows/latest-jdk-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# 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.
name: Latest JDK versions report

on:
schedule:
- cron: '30 6 * * *'
workflow_dispatch:
inputs:
java-versions:
description: 'Comma-separated java-version values (default: every major from Java 6 through the newest GA release, and latest)'
required: false
default: ''
pull_request:
paths:
- 'src/reports/**'
- '.github/workflows/latest-jdk-versions.yml'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
name: Build report tool
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
cache: npm
- name: Install dependencies
run: npm ci
- name: Bundle report tool
run: npm run build:latest-versions-report
- name: Upload report tool
uses: actions/upload-artifact@v7
with:
name: latest-versions-report-tool
path: lib/latest-versions-report/
retention-days: 1

resolve:
name: Resolve versions (${{ matrix.platform }})
needs: build
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: macos-latest
platform: macos
- os: windows-latest
platform: windows
# Liberica's Solaris metadata is queried without running a Solaris JDK.
- os: ubuntu-latest
platform: solaris
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Resolve latest versions without downloading
run: node tool/index.js resolve "results/$REPORT_PLATFORM.json"
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
REPORT_PLATFORM: ${{ matrix.platform }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-${{ 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
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: node:24-alpine
defaults:
run:
shell: sh
steps:
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Resolve latest versions without downloading
run: node tool/index.js resolve results/alpine.json
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-alpine
path: results/
retention-days: 1

report:
name: Report
needs: [build, resolve, resolve-alpine]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Download resolved versions
uses: actions/download-artifact@v8
with:
pattern: latest-jdk-versions-*
path: results
merge-multiple: true
- name: Write report
run: node tool/index.js summarize results latest-jdk-versions.md
- name: Upload report
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-report
path: |
latest-jdk-versions.md
results/
retention-days: 30
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Basic validation](https://github.com/actions/setup-java/actions/workflows/basic-validation.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/basic-validation.yml)
[![Validate Java e2e](https://github.com/actions/setup-java/actions/workflows/e2e-versions.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/e2e-versions.yml)
[![Validate cache](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
[![Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml)

Set up Java for GitHub Actions workflows. `setup-java` installs a requested Java distribution, adds it to `PATH`, configures `JAVA_HOME`, and can optionally cache build dependencies for Apache Maven, Gradle, and sbt; generate Maven publishing configuration, verify JDK package signatures, manage multiple JDKs, and manage Maven toolchains.

Expand Down Expand Up @@ -245,6 +246,8 @@ 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`.

## Download integrity and signatures

`setup-java` automatically verifies downloaded archive checksums when a selected distribution publishes an authoritative checksum. Automatic checksum verification currently applies to `temurin`, `semeru`, `corretto`, `dragonwell`, `kona`, `sapmachine`, `graalvm`, `graalvm-community`, `zulu`, `oracle`, `oracle-openjdk`, `microsoft`, and `jetbrains`.
Expand Down
Loading
Loading