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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**

___

Expand Down Expand Up @@ -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.**

___

Expand All @@ -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
Expand Down
32 changes: 26 additions & 6 deletions src/ListOpenJavaDevelopmentKits.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +32,7 @@
*
* <ul>
* <li>{@code RELEASE}: Either a release number or a name of an early-access project
* <li>{@code VERSION}: Either a specific version or `latest`
* <li>{@code VERSION}: Either a specific version or `latest` or `stable`
* <li>{@code OS-NAME}: An operating system name, usually one of: `linux`, `macos`, `windows`
* <li>{@code OS-ARCH}: An operating system architecture, like: `aarch64`, `x64`, or `x64-musl`
* </ul>
Expand All @@ -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");

Expand Down Expand Up @@ -137,12 +144,25 @@ static List<String> 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<String>();
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();
Expand Down