| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add a `latest` alias for the `java-version` input that floats to the newest available stable (GA) release. It is normalized to the SemVer wildcard at the base-installer layer and always resolves from remote (like `check-latest: true`). List-based distributions resolve it automatically via the existing newest-first matching. Corretto selects its newest available major; Oracle and GraalVM look up the newest GA major via the Adoptium API and request it, failing with an actionable error if that major isn't published yet. The jdkfile distribution rejects `latest`. Closes #832 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Adds support for specifying java-version: latest in actions/setup-java, allowing workflows to float to the newest stable (GA) Java major release while ensuring the version is resolved from remote metadata (not a potentially stale runner toolcache).
Changes:
| File | Description |
|---|---|
| src/util.ts | Adds helper to resolve the newest GA major via Adoptium’s available_releases API. |
| src/setup-java.ts | Ensures toolchains receive the resolved version (not the literal latest). |
| src/distributions/oracle/installer.ts | Resolves latest to a concrete major via Adoptium, with an actionable error if Oracle hasn’t published yet. |
| src/distributions/local/installer.ts | Rejects latest for jdkfile installs (local file). |
| src/distributions/graalvm/installer.ts | Resolves latest to a major via Adoptium and improves “not yet available” messaging for Oracle-hosted GraalVM. |
| src/distributions/corretto/installer.ts | Resolves latest to the newest major present in Corretto’s index. |
| src/distributions/base-installer.ts | Adds latest tracking and ensures latest bypasses the toolcache short-circuit. |
| README.md | Documents the latest alias semantics and distribution-specific behavior/limitations. |
| action.yml | Updates java-version input description to mention the latest alias. |
| tests/util.test.ts | Adds unit tests for the new Adoptium-based major resolver. |
| tests/distributors/temurin-installer.test.ts | Verifies latest normalizes to wildcard and resolves to newest available version. |
| tests/distributors/oracle-installer.test.ts | Tests latest major resolution via Adoptium and “not yet available” behavior. |
| tests/distributors/local-installer.test.ts | Tests rejection of latest for jdkfile. |
| tests/distributors/graalvm-installer.test.ts | Tests latest major resolution via Adoptium and “not yet available” behavior. |
| tests/distributors/corretto-installer.test.ts | Tests latest resolution to the newest available Corretto major. |
| tests/distributors/base-installer.test.ts | Tests that latest forces remote resolution and normalizes correctly. |
| dist/setup/index.js | Bundled output update reflecting source changes. |
| dist/cleanup/index.js | Bundled output update reflecting source changes. |
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
GraalVM Community publishes its releases on GitHub, so the `latest` alias now matches against that real release list using the SemVer wildcard instead of asking the Adoptium API for the newest GA major. This prevents `latest` from hard-failing when GraalVM lags behind a freshly released Java major (e.g. Adoptium reports 26 before GraalVM ships it). Oracle GraalVM has no listing endpoint, so it keeps deriving the newest major from Adoptium and errors clearly if that major is not yet published. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ava-version-latest # Conflicts: # __tests__/distributors/base-installer.test.ts
…ava-version-latest
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Inputs like 'latest-ea' had their '-ea' suffix stripped and fell through to the generic SemVer validation, failing with a confusing "'latest' is not valid SemVer" message even though 'latest' is supported. Add an explicit guard so any 'latest*' value other than exactly 'latest' throws a targeted error explaining that 'latest' resolves GA releases only and cannot be combined with '-ea' or other qualifiers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Description:
Adds a latest alias for the java-version input so workflows can float to the newest available stable (GA) Java release without pinning a specific major. This future-proofs CI pipelines and matches the latest convention other ecosystems (for example Go) already offer.
The alias is normalized to the SemVer wildcard at the base-installer layer and always resolves from remote (behaves like check-latest: true), so it never returns a stale version that happens to be pre-cached on the runner.
Resolution by distribution family:
latest is supported only through the java-version input (not java-version-file) and resolves GA releases only (it cannot be combined with -ea). Toolchains configuration receives the resolved version rather than the literal latest.
Related issue:
Fixes: #832
Check list: