Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ steps:
| `java-version-file` | Path to `.java-version`, `.tool-versions`, or `.sdkmanrc`. Used when `java-version` is not set. | |
| `distribution` | Java distribution keyword. Values are case-sensitive and must match one of the supported keywords below. Required unless `java-version-file` points to `.sdkmanrc` with a recognized distribution suffix. | |
| `java-package` | Package variant such as `jdk`, `jre`, `jdk+fx`, `jre+fx`, `jdk+crac`, `jre+crac`, `jdk+jmods`, `jdk+jcef`, `jre+jcef`, `jdk+ft`, or `jre+ft`. Support varies by distribution. | `jdk` |
| `architecture` | Package architecture. Canonical values are `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, and `s390x`. Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized. | Runner architecture |
| `architecture` | Package architecture. Canonical values are `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, `riscv64`, and `s390x`. Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized. | Runner architecture |
| `jdk-file` | Local compressed JDK archive. Requires `distribution: jdkfile`. | |
| `check-latest` | Check remote metadata for the latest version satisfying the version spec before using the runner tool cache. | `false` |
| `force-download` | Always download Java and replace any matching version in the tool cache. | `false` |
Expand Down
3 changes: 2 additions & 1 deletion __tests__/distributors/temurin-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ describe('getAvailableVersions', () => {
it.each([
['amd64', 'x64'],
['arm', 'arm'],
['arm64', 'aarch64']
['arm64', 'aarch64'],
['riscv64', 'riscv64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
Expand Down
8 changes: 8 additions & 0 deletions __tests__/java-platform-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('Java platform capabilities', () => {
['aarch64', 'aarch64'],
['arm64', 'aarch64'],
['ppc64le', 'ppc64le'],
['RISCV64', 'riscv64'],
['s390x', 's390x']
])('normalizes architecture %s to %s', (input, expected) => {
expect(normalizeArchitecture(input)).toBe(expected);
Expand Down Expand Up @@ -68,6 +69,12 @@ describe('Java platform capabilities', () => {
);
});

it('allows Temurin on Linux riscv64', () => {
expect(validateJavaPlatform('temurin', 'linux', 'riscv64', '25')).toBe(
'riscv64'
);
});

it('rejects OS-specific restrictions with a consistent diagnostic', () => {
expect(() =>
validateJavaPlatform('oracle', 'win32', 'arm64', '21')
Expand Down Expand Up @@ -115,6 +122,7 @@ describe('Java platform capabilities', () => {
'aarch64',
'ppc64le',
'ppc64',
'riscv64',
's390x'
]) {
expect(content).toContain(architecture);
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
required: false
default: 'jdk'
architecture:
description: "The architecture of the package (`x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, or `s390x`). Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized to `x86`, `x64`, `armv7`, and `aarch64`. Supported values vary by distribution and operating system. Defaults to the action runner's architecture."
description: "The architecture of the package (`x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, `riscv64`, or `s390x`). Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized to `x86`, `x64`, `armv7`, and `aarch64`. Supported values vary by distribution and operating system. Defaults to the action runner's architecture."
required: false
jdk-file:
description: 'Path to where the compressed JDK is located'
Expand Down
7 changes: 6 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31026,7 +31026,11 @@ const STANDARD_LINUX = ['x64', 'x86', 'aarch64', 'ppc64le', 's390x'];
const JAVA_PLATFORM_CAPABILITIES = {
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Temurin]: {
platforms: {
linux: [...STANDARD_LINUX, { architecture: 'armv7', versionRange: '<18' }],
linux: [
...STANDARD_LINUX,
'riscv64',
{ architecture: 'armv7', versionRange: '<18' }
],
macos: X64_ARM64,
windows: ['x64', 'x86', 'aarch64']
}
Expand Down Expand Up @@ -31164,6 +31168,7 @@ const CANONICAL_ARCHITECTURES = [
'aarch64',
'ppc64le',
'ppc64',
'riscv64',
's390x'
];
const PLATFORM_ALIASES = {
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ absent from a vendor catalog.

| Distribution | Linux | macOS | Windows | Other / version restrictions |
| --- | --- | --- | --- | --- |
| `temurin` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le`, `s390x` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Linux `armv7` is available through Java 17. |
| `temurin` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le`, `riscv64`, `s390x` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Linux `armv7` is available through Java 17. |
| `zulu` | `x64`, `x86`, `armv7`, `aarch64` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | |
| `liberica` | `x64`, `x86`, `armv7`, `aarch64`, `ppc64le` | `x64`, `aarch64` | `x64`, `x86`, `aarch64` | Solaris: `x64`. |
| `liberica-nik` | `x64`, `aarch64` | `x64`, `aarch64` | `x64`, `aarch64` | |
Expand Down
16 changes: 14 additions & 2 deletions src/distributions/platform-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import {JavaDistribution} from './package-types.js';
export type JavaPlatform = 'linux' | 'macos' | 'windows' | 'solaris';

export type JavaArchitecture =
'x86' | 'x64' | 'armv7' | 'aarch64' | 'ppc64le' | 'ppc64' | 's390x';
| 'x86'
| 'x64'
| 'armv7'
| 'aarch64'
| 'ppc64le'
| 'ppc64'
| 'riscv64'
| 's390x';

interface VersionedArchitecture {
architecture: JavaArchitecture;
Expand Down Expand Up @@ -35,7 +42,11 @@ export const JAVA_PLATFORM_CAPABILITIES: Record<
> = {
[JavaDistribution.Temurin]: {
platforms: {
linux: [...STANDARD_LINUX, {architecture: 'armv7', versionRange: '<18'}],
linux: [
...STANDARD_LINUX,
'riscv64',
{architecture: 'armv7', versionRange: '<18'}
],
macos: X64_ARM64,
windows: ['x64', 'x86', 'aarch64']
}
Expand Down Expand Up @@ -174,6 +185,7 @@ const CANONICAL_ARCHITECTURES: readonly JavaArchitecture[] = [
'aarch64',
'ppc64le',
'ppc64',
'riscv64',
's390x'
];

Expand Down