diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c72723..6615fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project uses tags and branches for [release management](https://docs.github ## [Unreleased] +### Added +- Java `23` and `24` to the list of Early-Access releases +- New `version: stable` mode for `release: ea` setups ## [1.3.4] - 2024-03-21 ### Fixed diff --git a/README.md b/README.md index 69685d1..aef07be 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,9 @@ It is set by default to `latest`. ___ -**WARNING!** - -Older versions of the JDK are provided to help developers debug issues in older systems. -**They are not updated with the latest security patches and are not recommended for use in production.** +> [!CAUTION] +> Older versions of the JDK are provided to help developers debug issues in older systems. +> **They are not updated with the latest security patches and are not recommended for use in production.** ___ @@ -111,10 +110,9 @@ steps: ``` ___ -**WARNING!** - -Older versions of the JDK are provided to help developers debug issues in older systems. -**They are not updated with the latest security patches and are not recommended for use in production.** +> [!CAUTION] +> Older versions of the JDK are provided to help developers debug issues in older systems. +> **They are not updated with the latest security patches and are not recommended for use in production.** ___ @@ -133,6 +131,11 @@ steps: release: N # Replace N with GA, EA, 17, 18, 19, ... ``` +> [!NOTE] +> This action supports two `version` update early-access modes for `release: EA` on `jdk.java.net`: +> - `version: latest` updates as early as possible to the latest-and-greatest JDK build (default) +> - `version: stable` updates later in the release cycle, usually then a new JDK build goes GA + ### Download and install an Early-Access build of a named OpenJDK project ```yaml diff --git a/src/ListOpenJavaDevelopmentKits.java b/src/ListOpenJavaDevelopmentKits.java index 1155dcd..03c7af3 100644 --- a/src/ListOpenJavaDevelopmentKits.java +++ b/src/ListOpenJavaDevelopmentKits.java @@ -9,6 +9,7 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; import java.util.TreeMap; @@ -31,7 +32,7 @@ * * @@ -47,6 +48,12 @@ class ListOpenJavaDevelopmentKits { /** Early-Access Releases, as comma separated names. */ static final String EA = System.getProperty("EA", "24,23,jextract,loom,valhalla"); + /** Current "latest" Early-Access Release number. */ + static final String EA_LATEST = System.getProperty("EA_LATEST", "24"); + + /** Current "stable" Early-Access Release number. */ + static final String EA_STABLE = System.getProperty("EA_STABLE", "23"); + /** Include archived releases flag. */ static final boolean ARCHIVES = Boolean.getBoolean("ARCHIVES"); @@ -137,12 +144,25 @@ static List generateEarlyAccessAliasKeys(String[] components) { var from = version.indexOf('-'); var till = version.indexOf('+'); var project = from >= 0 && from < till ? version.substring(from + 1, till) : version; - components[0] = project; + if (project.equals("ea")) { + var earlyAccessAliases = new ArrayList(); + components[0] = release; // "23", "24", ... + components[1] = "latest"; + earlyAccessAliases.add(String.join(",", components)); + components[0] = "ea"; + if (release.equals(EA_LATEST)) { + components[1] = "latest"; + earlyAccessAliases.add(String.join(",", components)); + } + if (release.equals(EA_STABLE)) { + components[1] = "stable"; + earlyAccessAliases.add(String.join(",", components)); + } + return earlyAccessAliases; + } + components[0] = project; // "loom", "valhalla", ... components[1] = "latest"; - var alias = String.join(",", components); - if (!project.equals("ea")) return List.of(alias); - components[0] = release; // 18-latest-... - return List.of(alias, String.join(",", components)); + return List.of(String.join(",", components)); } catch (IndexOutOfBoundsException exception) { System.err.println("Early-Access version without `-` and `+`: " + version); return List.of();