Use java-package input instead of version

This commit is contained in:
peterz 2024-03-06 15:40:00 +03:00 committed by Fabio Niephaus
parent 6670574f7f
commit 30261a858e
No known key found for this signature in database
GPG Key ID: F21CF5275F31DFD6
9 changed files with 47 additions and 35 deletions

View File

@ -245,12 +245,12 @@ jobs:
if: runner.os == 'Windows' if: runner.os == 'Windows'
test-liberica: test-liberica:
needs: test needs: test
name: Liberica (${{ matrix.java-version }}, '${{ matrix.version }}', ${{ matrix.os }}) name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }})
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
java-version: ['17', '21.0.2'] java-version: ['17', '21.0.2']
version: ['', 'std', 'full'] java-package: ['', 'jdk', 'jdk+fx']
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -259,7 +259,7 @@ jobs:
with: with:
distribution: liberica distribution: liberica
java-version: ${{ matrix.java-version }} java-version: ${{ matrix.java-version }}
version: ${{ matrix.version }} java-package: ${{ matrix.java-package }}
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check environment - name: Check environment
run: | run: |

View File

@ -189,6 +189,7 @@ can be replaced with:
|-----------------|:--------:|-------------| |-----------------|:--------:|-------------|
| `java-version`<br>*(required)* | n/a | Java version <ul><li>major versions: `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.2'`, `'17.0.7'`</li><li>early access (EA) builds: `'22-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'`</li></ul> | | `java-version`<br>*(required)* | n/a | Java version <ul><li>major versions: `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.2'`, `'17.0.7'`</li><li>early access (EA) builds: `'22-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'`</li></ul> |
| `distribution` | `'graalvm'` | GraalVM distribution <ul><li>Oracle GraalVM: `'graalvm'`</li><li>GraalVM Community Edition: `'graalvm-community'`</li><li>Mandrel: `'mandrel'`</li><li>Liberica: `'liberica'`</li></ul> | | `distribution` | `'graalvm'` | GraalVM distribution <ul><li>Oracle GraalVM: `'graalvm'`</li><li>GraalVM Community Edition: `'graalvm-community'`</li><li>Mandrel: `'mandrel'`</li><li>Liberica: `'liberica'`</li></ul> |
| `java-package` | `'jdk'` | The package type (`'jdk'` or `'jdk+fx'`). Currently applies to Liberica only. |
| `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. | | `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. |
| `set-java-home` | `'true'` | If set to `'true'`, instructs the action to set `$JAVA_HOME` to the path of the GraalVM installation. Overrides any previous action or command that sets `$JAVA_HOME`. | | `set-java-home` | `'true'` | If set to `'true'`, instructs the action to set `$JAVA_HOME` to the path of the GraalVM installation. Overrides any previous action or command that sets `$JAVA_HOME`. |
| `cache` | `''` | Name of the build platform to cache dependencies. Turned off by default (`''`). It can also be `'maven'`, `'gradle'`, or `'sbt'` and works the same way as described in [actions/setup-java][setup-java-caching]. | | `cache` | `''` | Name of the build platform to cache dependencies. Turned off by default (`''`). It can also be `'maven'`, `'gradle'`, or `'sbt'` and works the same way as described in [actions/setup-java][setup-java-caching]. |
@ -197,7 +198,7 @@ can be replaced with:
| `native-image-job-reports` *) | `'false'` | If set to `'true'`, post a job summary containing a Native Image build report. | | `native-image-job-reports` *) | `'false'` | If set to `'true'`, post a job summary containing a Native Image build report. |
| `native-image-pr-reports` *) | `'false'` | If set to `'true'`, post a comment containing a Native Image build report on pull requests. Requires `write` permissions for the [`pull-requests` scope][gha-permissions]. | | `native-image-pr-reports` *) | `'false'` | If set to `'true'`, post a comment containing a Native Image build report on pull requests. Requires `write` permissions for the [`pull-requests` scope][gha-permissions]. |
| `components` | `''` | Comma-separated list of GraalVM components (e.g., `native-image` or `ruby,nodejs`) that will be installed by the [GraalVM Updater][gu]. | | `components` | `''` | Comma-separated list of GraalVM components (e.g., `native-image` or `ruby,nodejs`) that will be installed by the [GraalVM Updater][gu]. |
| `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z.W` or `X.Y.Z.W-Final` (e.g., `mandrel-21.3.0.0-Final` or `21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` or `latest` for the latest Mandrel stable release, <br>`std` (default) or `full` for Liberica| | `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z.W` or `X.Y.Z.W-Final` (e.g., `mandrel-21.3.0.0-Final` or `21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` or `latest` for the latest Mandrel stable release. |
| `gds-token` | `''` | Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)). | | `gds-token` | `''` | Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)). |
**) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.* **) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.*

View File

@ -37,13 +37,13 @@ test('find latest JDK version', async () => {
test('find asset URL', async () => { test('find asset URL', async () => {
await expectURL('11.0.22+12', '', 'bellsoft-liberica-vm-openjdk11.0.22') await expectURL('11.0.22+12', '', 'bellsoft-liberica-vm-openjdk11.0.22')
await expectURL('17.0.10+13', 'std', 'bellsoft-liberica-vm-openjdk17.0.10') await expectURL('17.0.10+13', 'jdk', 'bellsoft-liberica-vm-openjdk17.0.10')
if (!c.IS_LINUX) { if (!c.IS_LINUX) {
// This check can fail on Linux because there's no `full` version for aarch64 and/or musl // This check can fail on Linux because there's no `jdk+fx` package for aarch64 and/or musl
await expectURL( await expectURL(
'21.0.2+14', '21.0.2+14',
'full', 'jdk+fx',
'bellsoft-liberica-vm-full-openjdk21.0.2' 'bellsoft-liberica-vm-full-openjdk21.0.2'
) )
} }
@ -127,10 +127,10 @@ async function expectLatestToFail(pattern: string) {
async function expectURL( async function expectURL(
javaVersion: string, javaVersion: string,
version: string, javaPackage: string,
expectedPrefix: string expectedPrefix: string
) { ) {
const url = await liberica.findLibericaURL(javaVersion, version) const url = await liberica.findLibericaURL(javaVersion, javaPackage)
expect(url).toBeDefined() expect(url).toBeDefined()
const parts = url.split('/') const parts = url.split('/')
const file = parts[parts.length - 1] const file = parts[parts.length - 1]

View File

@ -8,6 +8,10 @@ inputs:
java-version: java-version:
required: true required: true
description: 'Java version. See examples of supported syntax in the README file.' description: 'Java version. See examples of supported syntax in the README file.'
java-package:
description: 'The package type (jdk or jdk+fx). Currently applies to Liberica only.'
required: false
default: 'jdk'
distribution: distribution:
description: 'GraalVM distribution. See the list of available distributions in the README file.' description: 'GraalVM distribution. See the list of available distributions in the README file.'
required: false required: false

3
dist/cleanup/index.js generated vendored
View File

@ -92175,10 +92175,11 @@ else {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = void 0; exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = void 0;
exports.INPUT_VERSION = 'version'; exports.INPUT_VERSION = 'version';
exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_GDS_TOKEN = 'gds-token';
exports.INPUT_JAVA_VERSION = 'java-version'; exports.INPUT_JAVA_VERSION = 'java-version';
exports.INPUT_JAVA_PACKAGE = 'java-package';
exports.INPUT_DISTRIBUTION = 'distribution'; exports.INPUT_DISTRIBUTION = 'distribution';
exports.INPUT_COMPONENTS = 'components'; exports.INPUT_COMPONENTS = 'components';
exports.INPUT_GITHUB_TOKEN = 'github-token'; exports.INPUT_GITHUB_TOKEN = 'github-token';

26
dist/main/index.js generated vendored
View File

@ -92741,10 +92741,11 @@ function wrappy (fn, cb) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = void 0; exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = void 0;
exports.INPUT_VERSION = 'version'; exports.INPUT_VERSION = 'version';
exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_GDS_TOKEN = 'gds-token';
exports.INPUT_JAVA_VERSION = 'java-version'; exports.INPUT_JAVA_VERSION = 'java-version';
exports.INPUT_JAVA_PACKAGE = 'java-package';
exports.INPUT_DISTRIBUTION = 'distribution'; exports.INPUT_DISTRIBUTION = 'distribution';
exports.INPUT_COMPONENTS = 'components'; exports.INPUT_COMPONENTS = 'components';
exports.INPUT_GITHUB_TOKEN = 'github-token'; exports.INPUT_GITHUB_TOKEN = 'github-token';
@ -94254,11 +94255,11 @@ const LIBERICA_GH_USER = 'bell-sw';
const LIBERICA_RELEASES_REPO = 'LibericaNIK'; const LIBERICA_RELEASES_REPO = 'LibericaNIK';
const LIBERICA_JDK_TAG_PREFIX = 'jdk-'; const LIBERICA_JDK_TAG_PREFIX = 'jdk-';
const LIBERICA_VM_PREFIX = 'bellsoft-liberica-vm-'; const LIBERICA_VM_PREFIX = 'bellsoft-liberica-vm-';
function setUpLiberica(javaVersion, version) { function setUpLiberica(javaVersion, javaPackage) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const resolvedJavaVersion = yield findLatestLibericaJavaVersion(javaVersion); const resolvedJavaVersion = yield findLatestLibericaJavaVersion(javaVersion);
const downloadUrl = yield findLibericaURL(resolvedJavaVersion, version); const downloadUrl = yield findLibericaURL(resolvedJavaVersion, javaPackage);
const toolName = determineToolName(javaVersion, version); const toolName = determineToolName(javaVersion, javaPackage);
return (0, utils_1.downloadExtractAndCacheJDK)(() => __awaiter(this, void 0, void 0, function* () { return (0, tool_cache_1.downloadTool)(downloadUrl); }), toolName, javaVersion); return (0, utils_1.downloadExtractAndCacheJDK)(() => __awaiter(this, void 0, void 0, function* () { return (0, tool_cache_1.downloadTool)(downloadUrl); }), toolName, javaVersion);
}); });
} }
@ -94287,11 +94288,11 @@ function findLatestLibericaJavaVersion(javaVersion) {
}); });
} }
exports.findLatestLibericaJavaVersion = findLatestLibericaJavaVersion; exports.findLatestLibericaJavaVersion = findLatestLibericaJavaVersion;
function findLibericaURL(javaVersion, version) { function findLibericaURL(javaVersion, javaPackage) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const release = yield (0, utils_1.getTaggedRelease)(LIBERICA_GH_USER, LIBERICA_RELEASES_REPO, LIBERICA_JDK_TAG_PREFIX + javaVersion); const release = yield (0, utils_1.getTaggedRelease)(LIBERICA_GH_USER, LIBERICA_RELEASES_REPO, LIBERICA_JDK_TAG_PREFIX + javaVersion);
const platform = determinePlatformPart(); const platform = determinePlatformPart();
const assetPrefix = `${LIBERICA_VM_PREFIX}${determineToolVersionPart(version)}openjdk${javaVersion}`; const assetPrefix = `${LIBERICA_VM_PREFIX}${determineVariantPart(javaPackage)}openjdk${javaVersion}`;
const assetSuffix = `-${platform}${c.GRAALVM_FILE_EXTENSION}`; const assetSuffix = `-${platform}${c.GRAALVM_FILE_EXTENSION}`;
for (const asset of release.assets) { for (const asset of release.assets) {
if (asset.name.startsWith(assetPrefix) && if (asset.name.startsWith(assetPrefix) &&
@ -94299,15 +94300,17 @@ function findLibericaURL(javaVersion, version) {
return asset.browser_download_url; return asset.browser_download_url;
} }
} }
throw new Error(`Unable to find asset for java-version: ${javaVersion}, version: ${version}, platform: ${platform}`); throw new Error(`Unable to find asset for java-version: ${javaVersion}, java-package: ${javaPackage}, platform: ${platform}`);
}); });
} }
exports.findLibericaURL = findLibericaURL; exports.findLibericaURL = findLibericaURL;
function determineToolVersionPart(version) { function determineToolName(javaVersion, javaPackage) {
return version === 'std' || version === '' ? '' : `${version}-`; const variant = determineVariantPart(javaPackage);
const platform = determinePlatformPart();
return `${LIBERICA_VM_PREFIX}${variant}openjdk${javaVersion}-${platform}`;
} }
function determineToolName(javaVersion, version) { function determineVariantPart(javaPackage) {
return `${LIBERICA_VM_PREFIX}${determineToolVersionPart(version)}openjdk${javaVersion}-${determinePlatformPart()}`; return javaPackage !== null && javaPackage.includes('+fx') ? 'full-' : '';
} }
function determinePlatformPart() { function determinePlatformPart() {
if (isMuslBasedLinux()) { if (isMuslBasedLinux()) {
@ -94391,6 +94394,7 @@ function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, { required: true }); const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, { required: true });
const javaPackage = core.getInput(c.INPUT_JAVA_PACKAGE);
const distribution = core.getInput(c.INPUT_DISTRIBUTION); const distribution = core.getInput(c.INPUT_DISTRIBUTION);
const graalVMVersion = core.getInput(c.INPUT_VERSION); const graalVMVersion = core.getInput(c.INPUT_VERSION);
const gdsToken = core.getInput(c.INPUT_GDS_TOKEN); const gdsToken = core.getInput(c.INPUT_GDS_TOKEN);

View File

@ -3,6 +3,7 @@ import * as otypes from '@octokit/types'
export const INPUT_VERSION = 'version' export const INPUT_VERSION = 'version'
export const INPUT_GDS_TOKEN = 'gds-token' export const INPUT_GDS_TOKEN = 'gds-token'
export const INPUT_JAVA_VERSION = 'java-version' export const INPUT_JAVA_VERSION = 'java-version'
export const INPUT_JAVA_PACKAGE = 'java-package'
export const INPUT_DISTRIBUTION = 'distribution' export const INPUT_DISTRIBUTION = 'distribution'
export const INPUT_COMPONENTS = 'components' export const INPUT_COMPONENTS = 'components'
export const INPUT_GITHUB_TOKEN = 'github-token' export const INPUT_GITHUB_TOKEN = 'github-token'

View File

@ -15,11 +15,11 @@ const LIBERICA_VM_PREFIX = 'bellsoft-liberica-vm-'
export async function setUpLiberica( export async function setUpLiberica(
javaVersion: string, javaVersion: string,
version: string javaPackage: string
): Promise<string> { ): Promise<string> {
const resolvedJavaVersion = await findLatestLibericaJavaVersion(javaVersion) const resolvedJavaVersion = await findLatestLibericaJavaVersion(javaVersion)
const downloadUrl = await findLibericaURL(resolvedJavaVersion, version) const downloadUrl = await findLibericaURL(resolvedJavaVersion, javaPackage)
const toolName = determineToolName(javaVersion, version) const toolName = determineToolName(javaVersion, javaPackage)
return downloadExtractAndCacheJDK( return downloadExtractAndCacheJDK(
async () => downloadTool(downloadUrl), async () => downloadTool(downloadUrl),
toolName, toolName,
@ -61,7 +61,7 @@ export async function findLatestLibericaJavaVersion(
export async function findLibericaURL( export async function findLibericaURL(
javaVersion: string, javaVersion: string,
version: string javaPackage: string
): Promise<string> { ): Promise<string> {
const release = await getTaggedRelease( const release = await getTaggedRelease(
LIBERICA_GH_USER, LIBERICA_GH_USER,
@ -69,8 +69,8 @@ export async function findLibericaURL(
LIBERICA_JDK_TAG_PREFIX + javaVersion LIBERICA_JDK_TAG_PREFIX + javaVersion
) )
const platform = determinePlatformPart() const platform = determinePlatformPart()
const assetPrefix = `${LIBERICA_VM_PREFIX}${determineToolVersionPart( const assetPrefix = `${LIBERICA_VM_PREFIX}${determineVariantPart(
version javaPackage
)}openjdk${javaVersion}` )}openjdk${javaVersion}`
const assetSuffix = `-${platform}${c.GRAALVM_FILE_EXTENSION}` const assetSuffix = `-${platform}${c.GRAALVM_FILE_EXTENSION}`
for (const asset of release.assets) { for (const asset of release.assets) {
@ -82,18 +82,18 @@ export async function findLibericaURL(
} }
} }
throw new Error( throw new Error(
`Unable to find asset for java-version: ${javaVersion}, version: ${version}, platform: ${platform}` `Unable to find asset for java-version: ${javaVersion}, java-package: ${javaPackage}, platform: ${platform}`
) )
} }
function determineToolVersionPart(version: string) { function determineToolName(javaVersion: string, javaPackage: string) {
return version === 'std' || version === '' ? '' : `${version}-` const variant = determineVariantPart(javaPackage)
const platform = determinePlatformPart()
return `${LIBERICA_VM_PREFIX}${variant}openjdk${javaVersion}-${platform}`
} }
function determineToolName(javaVersion: string, version: string) { function determineVariantPart(javaPackage: string) {
return `${LIBERICA_VM_PREFIX}${determineToolVersionPart( return javaPackage !== null && javaPackage.includes('+fx') ? 'full-' : ''
version
)}openjdk${javaVersion}-${determinePlatformPart()}`
} }
function determinePlatformPart() { function determinePlatformPart() {

View File

@ -18,6 +18,7 @@ import {exec} from '@actions/exec'
async function run(): Promise<void> { async function run(): Promise<void> {
try { try {
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, {required: true}) const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, {required: true})
const javaPackage = core.getInput(c.INPUT_JAVA_PACKAGE)
const distribution = core.getInput(c.INPUT_DISTRIBUTION) const distribution = core.getInput(c.INPUT_DISTRIBUTION)
const graalVMVersion = core.getInput(c.INPUT_VERSION) const graalVMVersion = core.getInput(c.INPUT_VERSION)
const gdsToken = core.getInput(c.INPUT_GDS_TOKEN) const gdsToken = core.getInput(c.INPUT_GDS_TOKEN)
@ -67,7 +68,7 @@ async function run(): Promise<void> {
graalVMHome = await setUpMandrel(graalVMVersion, javaVersion) graalVMHome = await setUpMandrel(graalVMVersion, javaVersion)
break break
case c.DISTRIBUTION_LIBERICA: case c.DISTRIBUTION_LIBERICA:
graalVMHome = await setUpLiberica(javaVersion, graalVMVersion) graalVMHome = await setUpLiberica(javaVersion, javaPackage)
break break
case '': case '':
if (javaVersion === c.VERSION_DEV) { if (javaVersion === c.VERSION_DEV) {