From 9a425fb910d23869ba10a52d34605e104602fc80 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 22 Feb 2024 12:11:46 +0100 Subject: [PATCH] Report `java --version` when done. Fixes #81 --- dist/cleanup/index.js | 3 ++- dist/main/index.js | 9 ++++++++- src/constants.ts | 2 ++ src/main.ts | 9 ++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 3e044eb..b586444 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -92172,7 +92172,7 @@ else { "use strict"; 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_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = 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_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.INPUT_VERSION = 'version'; exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_JAVA_VERSION = 'java-version'; @@ -92186,6 +92186,7 @@ exports.INPUT_NI_MUSL = 'native-image-musl'; exports.IS_LINUX = process.platform === 'linux'; exports.IS_MACOS = process.platform === 'darwin'; exports.IS_WINDOWS = process.platform === 'win32'; +exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS ? '.exe' : ''; exports.DISTRIBUTION_GRAALVM = 'graalvm'; exports.DISTRIBUTION_GRAALVM_COMMUNITY = 'graalvm-community'; exports.DISTRIBUTION_MANDREL = 'mandrel'; diff --git a/dist/main/index.js b/dist/main/index.js index 3fb4701..4ee77b5 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -92738,7 +92738,7 @@ function wrappy (fn, cb) { "use strict"; 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_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = 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_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.INPUT_VERSION = 'version'; exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_JAVA_VERSION = 'java-version'; @@ -92752,6 +92752,7 @@ exports.INPUT_NI_MUSL = 'native-image-musl'; exports.IS_LINUX = process.platform === 'linux'; exports.IS_MACOS = process.platform === 'darwin'; exports.IS_WINDOWS = process.platform === 'win32'; +exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS ? '.exe' : ''; exports.DISTRIBUTION_GRAALVM = 'graalvm'; exports.DISTRIBUTION_GRAALVM_COMMUNITY = 'graalvm-community'; exports.DISTRIBUTION_MANDREL = 'mandrel'; @@ -94253,6 +94254,7 @@ const check_for_updates_1 = __nccwpck_require__(6780); const musl_1 = __nccwpck_require__(316); const msvc_1 = __nccwpck_require__(1165); const reports_1 = __nccwpck_require__(2046); +const exec_1 = __nccwpck_require__(1514); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -94360,6 +94362,11 @@ function run() { yield (0, cache_2.restore)(cache); } (0, reports_1.setUpNativeImageBuildReports)(isGraalVMforJDK17OrLater, graalVMVersion); + core.startGroup(`Successfully set up '${(0, path_1.basename)(graalVMHome)}'`); + yield (0, exec_1.exec)((0, path_1.join)(graalVMHome, 'bin', `java${c.EXECUTABLE_SUFFIX}`), [ + '--version' + ]); + core.endGroup(); } catch (error) { if (error instanceof Error) diff --git a/src/constants.ts b/src/constants.ts index 0960a19..fc63ffa 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -15,6 +15,8 @@ export const IS_LINUX = process.platform === 'linux' export const IS_MACOS = process.platform === 'darwin' export const IS_WINDOWS = process.platform === 'win32' +export const EXECUTABLE_SUFFIX = IS_WINDOWS ? '.exe' : '' + export const DISTRIBUTION_GRAALVM = 'graalvm' export const DISTRIBUTION_GRAALVM_COMMUNITY = 'graalvm-community' export const DISTRIBUTION_MANDREL = 'mandrel' diff --git a/src/main.ts b/src/main.ts index 759b972..b331a6d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,7 @@ import * as core from '@actions/core' import * as graalvm from './graalvm' import * as semver from 'semver' import {isFeatureAvailable as isCacheAvailable} from '@actions/cache' -import {join} from 'path' +import {basename, join} from 'path' import {restore} from './features/cache' import {setUpDependencies} from './dependencies' import {setUpGUComponents} from './gu' @@ -12,6 +12,7 @@ import {checkForUpdates} from './features/check-for-updates' import {setUpNativeImageMusl} from './features/musl' import {setUpWindowsEnvironment} from './msvc' import {setUpNativeImageBuildReports} from './features/reports' +import {exec} from '@actions/exec' async function run(): Promise { try { @@ -151,6 +152,12 @@ async function run(): Promise { await restore(cache) } setUpNativeImageBuildReports(isGraalVMforJDK17OrLater, graalVMVersion) + + core.startGroup(`Successfully set up '${basename(graalVMHome)}'`) + await exec(join(graalVMHome, 'bin', `java${c.EXECUTABLE_SUFFIX}`), [ + '--version' + ]) + core.endGroup() } catch (error) { if (error instanceof Error) core.setFailed(error.message) }