mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
GraalVM support
This commit is contained in:
parent
a12e082d83
commit
63715776f4
9 changed files with 7869 additions and 324 deletions
22
__tests__/distributors/graalvm-installer.test.ts
Normal file
22
__tests__/distributors/graalvm-installer.test.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import semver from 'semver';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
it('works', () => {
|
||||
const versions = [
|
||||
'1.2.3+22.0.0.2',
|
||||
'1.2.3+21.3.1',
|
||||
'1.2.3+20.3.5',
|
||||
'1.2.3+21.3.0',
|
||||
'1.2.3+20.3.4',
|
||||
'1.2.3+21.2.0',
|
||||
'1.2.3+20.3.3',
|
||||
'1.2.3+21.1.0',
|
||||
'1.2.3+20.3.2',
|
||||
'1.2.3+19.3.6',
|
||||
'1.2.3+21.0.0.2',
|
||||
'1.2.3+20.3.1.2',
|
||||
'1.2.3+21.0.0'
|
||||
];
|
||||
expect(versions.sort((x, y) => semver.compareBuild(x, y))).toEqual([]);
|
||||
});
|
||||
});
|
437
dist/cleanup/index.js
vendored
437
dist/cleanup/index.js
vendored
|
@ -48,6 +48,25 @@ module.exports =
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -58,11 +77,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const childProcess = __webpack_require__(129);
|
||||
const path = __webpack_require__(622);
|
||||
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
|
||||
const assert_1 = __webpack_require__(357);
|
||||
const childProcess = __importStar(__webpack_require__(129));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const util_1 = __webpack_require__(669);
|
||||
const ioUtil = __webpack_require__(672);
|
||||
const ioUtil = __importStar(__webpack_require__(672));
|
||||
const exec = util_1.promisify(childProcess.exec);
|
||||
const execFile = util_1.promisify(childProcess.execFile);
|
||||
/**
|
||||
* Copies a file or folder.
|
||||
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||||
|
@ -73,14 +95,14 @@ const exec = util_1.promisify(childProcess.exec);
|
|||
*/
|
||||
function cp(source, dest, options = {}) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { force, recursive } = readCopyOptions(options);
|
||||
const { force, recursive, copySourceDirectory } = readCopyOptions(options);
|
||||
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
|
||||
// Dest is an existing file, but not forcing
|
||||
if (destStat && destStat.isFile() && !force) {
|
||||
return;
|
||||
}
|
||||
// If dest is an existing directory, should copy inside.
|
||||
const newDest = destStat && destStat.isDirectory()
|
||||
const newDest = destStat && destStat.isDirectory() && copySourceDirectory
|
||||
? path.join(dest, path.basename(source))
|
||||
: dest;
|
||||
if (!(yield ioUtil.exists(source))) {
|
||||
|
@ -145,12 +167,22 @@ function rmRF(inputPath) {
|
|||
if (ioUtil.IS_WINDOWS) {
|
||||
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
|
||||
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
|
||||
// Check for invalid characters
|
||||
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
|
||||
if (/[*"<>|]/.test(inputPath)) {
|
||||
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
|
||||
}
|
||||
try {
|
||||
const cmdPath = ioUtil.getCmdPath();
|
||||
if (yield ioUtil.isDirectory(inputPath, true)) {
|
||||
yield exec(`rd /s /q "${inputPath}"`);
|
||||
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
else {
|
||||
yield exec(`del /f /a "${inputPath}"`);
|
||||
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -183,7 +215,7 @@ function rmRF(inputPath) {
|
|||
return;
|
||||
}
|
||||
if (isDir) {
|
||||
yield exec(`rm -rf "${inputPath}"`);
|
||||
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
|
||||
}
|
||||
else {
|
||||
yield ioUtil.unlink(inputPath);
|
||||
|
@ -201,7 +233,8 @@ exports.rmRF = rmRF;
|
|||
*/
|
||||
function mkdirP(fsPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield ioUtil.mkdirP(fsPath);
|
||||
assert_1.ok(fsPath, 'a path argument must be provided');
|
||||
yield ioUtil.mkdir(fsPath, { recursive: true });
|
||||
});
|
||||
}
|
||||
exports.mkdirP = mkdirP;
|
||||
|
@ -229,62 +262,80 @@ function which(tool, check) {
|
|||
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
// build the list of extensions to try
|
||||
const extensions = [];
|
||||
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
|
||||
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
|
||||
if (extension) {
|
||||
extensions.push(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if it's rooted, return it if exists. otherwise return empty.
|
||||
if (ioUtil.isRooted(tool)) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||
if (filePath) {
|
||||
return filePath;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
// if any path separators, return empty
|
||||
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
|
||||
return '';
|
||||
}
|
||||
// build the list of directories
|
||||
//
|
||||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||
// across platforms.
|
||||
const directories = [];
|
||||
if (process.env.PATH) {
|
||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||
if (p) {
|
||||
directories.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
// return the first match
|
||||
for (const directory of directories) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
|
||||
if (filePath) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(`which failed with message ${err.message}`);
|
||||
const matches = yield findInPath(tool);
|
||||
if (matches && matches.length > 0) {
|
||||
return matches[0];
|
||||
}
|
||||
return '';
|
||||
});
|
||||
}
|
||||
exports.which = which;
|
||||
/**
|
||||
* Returns a list of all occurrences of the given tool on the system path.
|
||||
*
|
||||
* @returns Promise<string[]> the paths of the tool
|
||||
*/
|
||||
function findInPath(tool) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!tool) {
|
||||
throw new Error("parameter 'tool' is required");
|
||||
}
|
||||
// build the list of extensions to try
|
||||
const extensions = [];
|
||||
if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
|
||||
for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
|
||||
if (extension) {
|
||||
extensions.push(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if it's rooted, return it if exists. otherwise return empty.
|
||||
if (ioUtil.isRooted(tool)) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||
if (filePath) {
|
||||
return [filePath];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
// if any path separators, return empty
|
||||
if (tool.includes(path.sep)) {
|
||||
return [];
|
||||
}
|
||||
// build the list of directories
|
||||
//
|
||||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||
// across platforms.
|
||||
const directories = [];
|
||||
if (process.env.PATH) {
|
||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||
if (p) {
|
||||
directories.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
// find all matches
|
||||
const matches = [];
|
||||
for (const directory of directories) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
||||
if (filePath) {
|
||||
matches.push(filePath);
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
});
|
||||
}
|
||||
exports.findInPath = findInPath;
|
||||
function readCopyOptions(options) {
|
||||
const force = options.force == null ? true : options.force;
|
||||
const recursive = Boolean(options.recursive);
|
||||
return { force, recursive };
|
||||
const copySourceDirectory = options.copySourceDirectory == null
|
||||
? true
|
||||
: Boolean(options.copySourceDirectory);
|
||||
return { force, recursive, copySourceDirectory };
|
||||
}
|
||||
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
@ -1350,6 +1401,25 @@ exports.default = _default;
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -1359,14 +1429,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
|
||||
const semver = __importStar(__webpack_require__(550));
|
||||
const core_1 = __webpack_require__(470);
|
||||
// needs to be require for core node modules to be mocked
|
||||
|
@ -1435,8 +1499,13 @@ function _getOsVersion() {
|
|||
const lines = lsbContents.split('\n');
|
||||
for (const line of lines) {
|
||||
const parts = line.split('=');
|
||||
if (parts.length === 2 && parts[0].trim() === 'DISTRIB_RELEASE') {
|
||||
version = parts[1].trim();
|
||||
if (parts.length === 2 &&
|
||||
(parts[0].trim() === 'VERSION_ID' ||
|
||||
parts[0].trim() === 'DISTRIB_RELEASE')) {
|
||||
version = parts[1]
|
||||
.trim()
|
||||
.replace(/^"/, '')
|
||||
.replace(/"$/, '');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1446,10 +1515,14 @@ function _getOsVersion() {
|
|||
}
|
||||
exports._getOsVersion = _getOsVersion;
|
||||
function _readLinuxVersionFile() {
|
||||
const lsbFile = '/etc/lsb-release';
|
||||
const lsbReleaseFile = '/etc/lsb-release';
|
||||
const osReleaseFile = '/etc/os-release';
|
||||
let contents = '';
|
||||
if (fs.existsSync(lsbFile)) {
|
||||
contents = fs.readFileSync(lsbFile).toString();
|
||||
if (fs.existsSync(lsbReleaseFile)) {
|
||||
contents = fs.readFileSync(lsbReleaseFile).toString();
|
||||
}
|
||||
else if (fs.existsSync(osReleaseFile)) {
|
||||
contents = fs.readFileSync(osReleaseFile).toString();
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
@ -45393,6 +45466,25 @@ module.exports = gtr
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -45402,17 +45494,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0;
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const io = __importStar(__webpack_require__(1));
|
||||
const fs = __importStar(__webpack_require__(747));
|
||||
|
@ -45444,9 +45530,10 @@ const userAgent = 'actions/tool-cache';
|
|||
* @param url url of tool to download
|
||||
* @param dest path to download tool
|
||||
* @param auth authorization header
|
||||
* @param headers other headers
|
||||
* @returns path to downloaded tool
|
||||
*/
|
||||
function downloadTool(url, dest, auth) {
|
||||
function downloadTool(url, dest, auth, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
dest = dest || path.join(_getTempDirectory(), v4_1.default());
|
||||
yield io.mkdirP(path.dirname(dest));
|
||||
|
@ -45457,7 +45544,7 @@ function downloadTool(url, dest, auth) {
|
|||
const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
|
||||
const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
|
||||
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||
return yield downloadToolAttempt(url, dest || '', auth);
|
||||
return yield downloadToolAttempt(url, dest || '', auth, headers);
|
||||
}), (err) => {
|
||||
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||
// Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
|
||||
|
@ -45473,7 +45560,7 @@ function downloadTool(url, dest, auth) {
|
|||
});
|
||||
}
|
||||
exports.downloadTool = downloadTool;
|
||||
function downloadToolAttempt(url, dest, auth) {
|
||||
function downloadToolAttempt(url, dest, auth, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (fs.existsSync(dest)) {
|
||||
throw new Error(`Destination file path ${dest} already exists`);
|
||||
|
@ -45482,12 +45569,12 @@ function downloadToolAttempt(url, dest, auth) {
|
|||
const http = new httpm.HttpClient(userAgent, [], {
|
||||
allowRetries: false
|
||||
});
|
||||
let headers;
|
||||
if (auth) {
|
||||
core.debug('set auth');
|
||||
headers = {
|
||||
authorization: auth
|
||||
};
|
||||
if (headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers.authorization = auth;
|
||||
}
|
||||
const response = yield http.get(url, headers);
|
||||
if (response.message.statusCode !== 200) {
|
||||
|
@ -45645,6 +45732,7 @@ function extractTar(file, dest, flags = 'xz') {
|
|||
if (isGnuTar) {
|
||||
// Suppress warnings when using GNU tar to extract archives created by BSD tar
|
||||
args.push('--warning=no-unknown-keyword');
|
||||
args.push('--overwrite');
|
||||
}
|
||||
args.push('-C', destArg, '-f', fileArg);
|
||||
yield exec_1.exec(`tar`, args);
|
||||
|
@ -45710,20 +45798,50 @@ function extractZipWin(file, dest) {
|
|||
// build the powershell command
|
||||
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
|
||||
const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
|
||||
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
|
||||
// run powershell
|
||||
const powershellPath = yield io.which('powershell', true);
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-Sta',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
command
|
||||
];
|
||||
yield exec_1.exec(`"${powershellPath}"`, args);
|
||||
const pwshPath = yield io.which('pwsh', false);
|
||||
//To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
|
||||
//and the -Force flag for Expand-Archive as a fallback
|
||||
if (pwshPath) {
|
||||
//attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
|
||||
const pwshCommand = [
|
||||
`$ErrorActionPreference = 'Stop' ;`,
|
||||
`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
|
||||
`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
|
||||
`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;`
|
||||
].join(' ');
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
pwshCommand
|
||||
];
|
||||
core.debug(`Using pwsh at path: ${pwshPath}`);
|
||||
yield exec_1.exec(`"${pwshPath}"`, args);
|
||||
}
|
||||
else {
|
||||
const powershellCommand = [
|
||||
`$ErrorActionPreference = 'Stop' ;`,
|
||||
`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
|
||||
`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
|
||||
`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
|
||||
].join(' ');
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-Sta',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
powershellCommand
|
||||
];
|
||||
const powershellPath = yield io.which('powershell', true);
|
||||
core.debug(`Using powershell at path: ${powershellPath}`);
|
||||
yield exec_1.exec(`"${powershellPath}"`, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
function extractZipNix(file, dest) {
|
||||
|
@ -45733,6 +45851,7 @@ function extractZipNix(file, dest) {
|
|||
if (!core.isDebug()) {
|
||||
args.unshift('-q');
|
||||
}
|
||||
args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
|
||||
yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
|
||||
});
|
||||
}
|
||||
|
@ -45815,9 +45934,9 @@ function find(toolName, versionSpec, arch) {
|
|||
}
|
||||
arch = arch || os.arch();
|
||||
// attempt to resolve an explicit version
|
||||
if (!_isExplicitVersion(versionSpec)) {
|
||||
if (!isExplicitVersion(versionSpec)) {
|
||||
const localVersions = findAllVersions(toolName, arch);
|
||||
const match = _evaluateVersions(localVersions, versionSpec);
|
||||
const match = evaluateVersions(localVersions, versionSpec);
|
||||
versionSpec = match;
|
||||
}
|
||||
// check for the explicit version in the cache
|
||||
|
@ -45850,7 +45969,7 @@ function findAllVersions(toolName, arch) {
|
|||
if (fs.existsSync(toolPath)) {
|
||||
const children = fs.readdirSync(toolPath);
|
||||
for (const child of children) {
|
||||
if (_isExplicitVersion(child)) {
|
||||
if (isExplicitVersion(child)) {
|
||||
const fullPath = path.join(toolPath, child, arch || '');
|
||||
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
|
||||
versions.push(child);
|
||||
|
@ -45933,14 +46052,26 @@ function _completeToolPath(tool, version, arch) {
|
|||
fs.writeFileSync(markerPath, '');
|
||||
core.debug('finished caching tool');
|
||||
}
|
||||
function _isExplicitVersion(versionSpec) {
|
||||
/**
|
||||
* Check if version string is explicit
|
||||
*
|
||||
* @param versionSpec version string to check
|
||||
*/
|
||||
function isExplicitVersion(versionSpec) {
|
||||
const c = semver.clean(versionSpec) || '';
|
||||
core.debug(`isExplicit: ${c}`);
|
||||
const valid = semver.valid(c) != null;
|
||||
core.debug(`explicit? ${valid}`);
|
||||
return valid;
|
||||
}
|
||||
function _evaluateVersions(versions, versionSpec) {
|
||||
exports.isExplicitVersion = isExplicitVersion;
|
||||
/**
|
||||
* Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
|
||||
*
|
||||
* @param versions array of versions to evaluate
|
||||
* @param versionSpec semantic version spec to satisfy
|
||||
*/
|
||||
function evaluateVersions(versions, versionSpec) {
|
||||
let version = '';
|
||||
core.debug(`evaluating ${versions.length} versions`);
|
||||
versions = versions.sort((a, b) => {
|
||||
|
@ -45965,6 +46096,7 @@ function _evaluateVersions(versions, versionSpec) {
|
|||
}
|
||||
return version;
|
||||
}
|
||||
exports.evaluateVersions = evaluateVersions;
|
||||
/**
|
||||
* Gets RUNNER_TOOL_CACHE
|
||||
*/
|
||||
|
@ -53108,6 +53240,25 @@ var __createBinding;
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -53119,9 +53270,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const assert_1 = __webpack_require__(357);
|
||||
const fs = __webpack_require__(747);
|
||||
const path = __webpack_require__(622);
|
||||
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
|
||||
const fs = __importStar(__webpack_require__(747));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||
exports.IS_WINDOWS = process.platform === 'win32';
|
||||
function exists(fsPath) {
|
||||
|
@ -53162,49 +53313,6 @@ function isRooted(p) {
|
|||
return p.startsWith('/');
|
||||
}
|
||||
exports.isRooted = isRooted;
|
||||
/**
|
||||
* Recursively create a directory at `fsPath`.
|
||||
*
|
||||
* This implementation is optimistic, meaning it attempts to create the full
|
||||
* path first, and backs up the path stack from there.
|
||||
*
|
||||
* @param fsPath The path to create
|
||||
* @param maxDepth The maximum recursion depth
|
||||
* @param depth The current recursion depth
|
||||
*/
|
||||
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
assert_1.ok(fsPath, 'a path argument must be provided');
|
||||
fsPath = path.resolve(fsPath);
|
||||
if (depth >= maxDepth)
|
||||
return exports.mkdir(fsPath);
|
||||
try {
|
||||
yield exports.mkdir(fsPath);
|
||||
return;
|
||||
}
|
||||
catch (err) {
|
||||
switch (err.code) {
|
||||
case 'ENOENT': {
|
||||
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
|
||||
yield exports.mkdir(fsPath);
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
let stats;
|
||||
try {
|
||||
stats = yield exports.stat(fsPath);
|
||||
}
|
||||
catch (err2) {
|
||||
throw err;
|
||||
}
|
||||
if (!stats.isDirectory())
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.mkdirP = mkdirP;
|
||||
/**
|
||||
* Best effort attempt to determine whether a file exists and is executable.
|
||||
* @param filePath file path to check
|
||||
|
@ -53301,6 +53409,12 @@ function isUnixExecutable(stats) {
|
|||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
|
||||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
|
||||
}
|
||||
// Get the path of cmd.exe in windows
|
||||
function getCmdPath() {
|
||||
var _a;
|
||||
return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
|
||||
}
|
||||
exports.getCmdPath = getCmdPath;
|
||||
//# sourceMappingURL=io-util.js.map
|
||||
|
||||
/***/ }),
|
||||
|
@ -64328,6 +64442,25 @@ createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$')
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -64337,14 +64470,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RetryHelper = void 0;
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
/**
|
||||
* Internal class for retries
|
||||
|
|
744
dist/setup/index.js
vendored
744
dist/setup/index.js
vendored
|
@ -48,6 +48,25 @@ module.exports =
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -58,11 +77,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const childProcess = __webpack_require__(129);
|
||||
const path = __webpack_require__(622);
|
||||
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
|
||||
const assert_1 = __webpack_require__(357);
|
||||
const childProcess = __importStar(__webpack_require__(129));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const util_1 = __webpack_require__(669);
|
||||
const ioUtil = __webpack_require__(672);
|
||||
const ioUtil = __importStar(__webpack_require__(672));
|
||||
const exec = util_1.promisify(childProcess.exec);
|
||||
const execFile = util_1.promisify(childProcess.execFile);
|
||||
/**
|
||||
* Copies a file or folder.
|
||||
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
|
||||
|
@ -73,14 +95,14 @@ const exec = util_1.promisify(childProcess.exec);
|
|||
*/
|
||||
function cp(source, dest, options = {}) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { force, recursive } = readCopyOptions(options);
|
||||
const { force, recursive, copySourceDirectory } = readCopyOptions(options);
|
||||
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
|
||||
// Dest is an existing file, but not forcing
|
||||
if (destStat && destStat.isFile() && !force) {
|
||||
return;
|
||||
}
|
||||
// If dest is an existing directory, should copy inside.
|
||||
const newDest = destStat && destStat.isDirectory()
|
||||
const newDest = destStat && destStat.isDirectory() && copySourceDirectory
|
||||
? path.join(dest, path.basename(source))
|
||||
: dest;
|
||||
if (!(yield ioUtil.exists(source))) {
|
||||
|
@ -145,12 +167,22 @@ function rmRF(inputPath) {
|
|||
if (ioUtil.IS_WINDOWS) {
|
||||
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
|
||||
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
|
||||
// Check for invalid characters
|
||||
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
|
||||
if (/[*"<>|]/.test(inputPath)) {
|
||||
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
|
||||
}
|
||||
try {
|
||||
const cmdPath = ioUtil.getCmdPath();
|
||||
if (yield ioUtil.isDirectory(inputPath, true)) {
|
||||
yield exec(`rd /s /q "${inputPath}"`);
|
||||
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
else {
|
||||
yield exec(`del /f /a "${inputPath}"`);
|
||||
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||
env: { inputPath }
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -183,7 +215,7 @@ function rmRF(inputPath) {
|
|||
return;
|
||||
}
|
||||
if (isDir) {
|
||||
yield exec(`rm -rf "${inputPath}"`);
|
||||
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
|
||||
}
|
||||
else {
|
||||
yield ioUtil.unlink(inputPath);
|
||||
|
@ -201,7 +233,8 @@ exports.rmRF = rmRF;
|
|||
*/
|
||||
function mkdirP(fsPath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield ioUtil.mkdirP(fsPath);
|
||||
assert_1.ok(fsPath, 'a path argument must be provided');
|
||||
yield ioUtil.mkdir(fsPath, { recursive: true });
|
||||
});
|
||||
}
|
||||
exports.mkdirP = mkdirP;
|
||||
|
@ -229,62 +262,80 @@ function which(tool, check) {
|
|||
throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
// build the list of extensions to try
|
||||
const extensions = [];
|
||||
if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
|
||||
for (const extension of process.env.PATHEXT.split(path.delimiter)) {
|
||||
if (extension) {
|
||||
extensions.push(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if it's rooted, return it if exists. otherwise return empty.
|
||||
if (ioUtil.isRooted(tool)) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||
if (filePath) {
|
||||
return filePath;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
// if any path separators, return empty
|
||||
if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
|
||||
return '';
|
||||
}
|
||||
// build the list of directories
|
||||
//
|
||||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||
// across platforms.
|
||||
const directories = [];
|
||||
if (process.env.PATH) {
|
||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||
if (p) {
|
||||
directories.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
// return the first match
|
||||
for (const directory of directories) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
|
||||
if (filePath) {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(`which failed with message ${err.message}`);
|
||||
const matches = yield findInPath(tool);
|
||||
if (matches && matches.length > 0) {
|
||||
return matches[0];
|
||||
}
|
||||
return '';
|
||||
});
|
||||
}
|
||||
exports.which = which;
|
||||
/**
|
||||
* Returns a list of all occurrences of the given tool on the system path.
|
||||
*
|
||||
* @returns Promise<string[]> the paths of the tool
|
||||
*/
|
||||
function findInPath(tool) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!tool) {
|
||||
throw new Error("parameter 'tool' is required");
|
||||
}
|
||||
// build the list of extensions to try
|
||||
const extensions = [];
|
||||
if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
|
||||
for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
|
||||
if (extension) {
|
||||
extensions.push(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if it's rooted, return it if exists. otherwise return empty.
|
||||
if (ioUtil.isRooted(tool)) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
|
||||
if (filePath) {
|
||||
return [filePath];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
// if any path separators, return empty
|
||||
if (tool.includes(path.sep)) {
|
||||
return [];
|
||||
}
|
||||
// build the list of directories
|
||||
//
|
||||
// Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
|
||||
// it feels like we should not do this. Checking the current directory seems like more of a use
|
||||
// case of a shell, and the which() function exposed by the toolkit should strive for consistency
|
||||
// across platforms.
|
||||
const directories = [];
|
||||
if (process.env.PATH) {
|
||||
for (const p of process.env.PATH.split(path.delimiter)) {
|
||||
if (p) {
|
||||
directories.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
// find all matches
|
||||
const matches = [];
|
||||
for (const directory of directories) {
|
||||
const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
|
||||
if (filePath) {
|
||||
matches.push(filePath);
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
});
|
||||
}
|
||||
exports.findInPath = findInPath;
|
||||
function readCopyOptions(options) {
|
||||
const force = options.force == null ? true : options.force;
|
||||
const recursive = Boolean(options.recursive);
|
||||
return { force, recursive };
|
||||
const copySourceDirectory = options.copySourceDirectory == null
|
||||
? true
|
||||
: Boolean(options.copySourceDirectory);
|
||||
return { force, recursive, copySourceDirectory };
|
||||
}
|
||||
function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
@ -2001,6 +2052,25 @@ exports.characterData_substringData = characterData_substringData;
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -2010,14 +2080,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
|
||||
const semver = __importStar(__webpack_require__(550));
|
||||
const core_1 = __webpack_require__(470);
|
||||
// needs to be require for core node modules to be mocked
|
||||
|
@ -2086,8 +2150,13 @@ function _getOsVersion() {
|
|||
const lines = lsbContents.split('\n');
|
||||
for (const line of lines) {
|
||||
const parts = line.split('=');
|
||||
if (parts.length === 2 && parts[0].trim() === 'DISTRIB_RELEASE') {
|
||||
version = parts[1].trim();
|
||||
if (parts.length === 2 &&
|
||||
(parts[0].trim() === 'VERSION_ID' ||
|
||||
parts[0].trim() === 'DISTRIB_RELEASE')) {
|
||||
version = parts[1]
|
||||
.trim()
|
||||
.replace(/^"/, '')
|
||||
.replace(/"$/, '');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2097,10 +2166,14 @@ function _getOsVersion() {
|
|||
}
|
||||
exports._getOsVersion = _getOsVersion;
|
||||
function _readLinuxVersionFile() {
|
||||
const lsbFile = '/etc/lsb-release';
|
||||
const lsbReleaseFile = '/etc/lsb-release';
|
||||
const osReleaseFile = '/etc/os-release';
|
||||
let contents = '';
|
||||
if (fs.existsSync(lsbFile)) {
|
||||
contents = fs.readFileSync(lsbFile).toString();
|
||||
if (fs.existsSync(lsbReleaseFile)) {
|
||||
contents = fs.readFileSync(lsbReleaseFile).toString();
|
||||
}
|
||||
else if (fs.existsSync(osReleaseFile)) {
|
||||
contents = fs.readFileSync(osReleaseFile).toString();
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
@ -10543,6 +10616,25 @@ exports.pop = pop;
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -10552,17 +10644,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0;
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const io = __importStar(__webpack_require__(1));
|
||||
const fs = __importStar(__webpack_require__(747));
|
||||
|
@ -10594,9 +10680,10 @@ const userAgent = 'actions/tool-cache';
|
|||
* @param url url of tool to download
|
||||
* @param dest path to download tool
|
||||
* @param auth authorization header
|
||||
* @param headers other headers
|
||||
* @returns path to downloaded tool
|
||||
*/
|
||||
function downloadTool(url, dest, auth) {
|
||||
function downloadTool(url, dest, auth, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
dest = dest || path.join(_getTempDirectory(), v4_1.default());
|
||||
yield io.mkdirP(path.dirname(dest));
|
||||
|
@ -10607,7 +10694,7 @@ function downloadTool(url, dest, auth) {
|
|||
const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
|
||||
const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
|
||||
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||
return yield downloadToolAttempt(url, dest || '', auth);
|
||||
return yield downloadToolAttempt(url, dest || '', auth, headers);
|
||||
}), (err) => {
|
||||
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||
// Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
|
||||
|
@ -10623,7 +10710,7 @@ function downloadTool(url, dest, auth) {
|
|||
});
|
||||
}
|
||||
exports.downloadTool = downloadTool;
|
||||
function downloadToolAttempt(url, dest, auth) {
|
||||
function downloadToolAttempt(url, dest, auth, headers) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (fs.existsSync(dest)) {
|
||||
throw new Error(`Destination file path ${dest} already exists`);
|
||||
|
@ -10632,12 +10719,12 @@ function downloadToolAttempt(url, dest, auth) {
|
|||
const http = new httpm.HttpClient(userAgent, [], {
|
||||
allowRetries: false
|
||||
});
|
||||
let headers;
|
||||
if (auth) {
|
||||
core.debug('set auth');
|
||||
headers = {
|
||||
authorization: auth
|
||||
};
|
||||
if (headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers.authorization = auth;
|
||||
}
|
||||
const response = yield http.get(url, headers);
|
||||
if (response.message.statusCode !== 200) {
|
||||
|
@ -10795,6 +10882,7 @@ function extractTar(file, dest, flags = 'xz') {
|
|||
if (isGnuTar) {
|
||||
// Suppress warnings when using GNU tar to extract archives created by BSD tar
|
||||
args.push('--warning=no-unknown-keyword');
|
||||
args.push('--overwrite');
|
||||
}
|
||||
args.push('-C', destArg, '-f', fileArg);
|
||||
yield exec_1.exec(`tar`, args);
|
||||
|
@ -10860,20 +10948,50 @@ function extractZipWin(file, dest) {
|
|||
// build the powershell command
|
||||
const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
|
||||
const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
|
||||
const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
|
||||
// run powershell
|
||||
const powershellPath = yield io.which('powershell', true);
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-Sta',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
command
|
||||
];
|
||||
yield exec_1.exec(`"${powershellPath}"`, args);
|
||||
const pwshPath = yield io.which('pwsh', false);
|
||||
//To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
|
||||
//and the -Force flag for Expand-Archive as a fallback
|
||||
if (pwshPath) {
|
||||
//attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
|
||||
const pwshCommand = [
|
||||
`$ErrorActionPreference = 'Stop' ;`,
|
||||
`try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
|
||||
`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
|
||||
`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force } else { throw $_ } } ;`
|
||||
].join(' ');
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
pwshCommand
|
||||
];
|
||||
core.debug(`Using pwsh at path: ${pwshPath}`);
|
||||
yield exec_1.exec(`"${pwshPath}"`, args);
|
||||
}
|
||||
else {
|
||||
const powershellCommand = [
|
||||
`$ErrorActionPreference = 'Stop' ;`,
|
||||
`try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
|
||||
`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
|
||||
`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
|
||||
].join(' ');
|
||||
const args = [
|
||||
'-NoLogo',
|
||||
'-Sta',
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-Command',
|
||||
powershellCommand
|
||||
];
|
||||
const powershellPath = yield io.which('powershell', true);
|
||||
core.debug(`Using powershell at path: ${powershellPath}`);
|
||||
yield exec_1.exec(`"${powershellPath}"`, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
function extractZipNix(file, dest) {
|
||||
|
@ -10883,6 +11001,7 @@ function extractZipNix(file, dest) {
|
|||
if (!core.isDebug()) {
|
||||
args.unshift('-q');
|
||||
}
|
||||
args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
|
||||
yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
|
||||
});
|
||||
}
|
||||
|
@ -10965,9 +11084,9 @@ function find(toolName, versionSpec, arch) {
|
|||
}
|
||||
arch = arch || os.arch();
|
||||
// attempt to resolve an explicit version
|
||||
if (!_isExplicitVersion(versionSpec)) {
|
||||
if (!isExplicitVersion(versionSpec)) {
|
||||
const localVersions = findAllVersions(toolName, arch);
|
||||
const match = _evaluateVersions(localVersions, versionSpec);
|
||||
const match = evaluateVersions(localVersions, versionSpec);
|
||||
versionSpec = match;
|
||||
}
|
||||
// check for the explicit version in the cache
|
||||
|
@ -11000,7 +11119,7 @@ function findAllVersions(toolName, arch) {
|
|||
if (fs.existsSync(toolPath)) {
|
||||
const children = fs.readdirSync(toolPath);
|
||||
for (const child of children) {
|
||||
if (_isExplicitVersion(child)) {
|
||||
if (isExplicitVersion(child)) {
|
||||
const fullPath = path.join(toolPath, child, arch || '');
|
||||
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
|
||||
versions.push(child);
|
||||
|
@ -11083,14 +11202,26 @@ function _completeToolPath(tool, version, arch) {
|
|||
fs.writeFileSync(markerPath, '');
|
||||
core.debug('finished caching tool');
|
||||
}
|
||||
function _isExplicitVersion(versionSpec) {
|
||||
/**
|
||||
* Check if version string is explicit
|
||||
*
|
||||
* @param versionSpec version string to check
|
||||
*/
|
||||
function isExplicitVersion(versionSpec) {
|
||||
const c = semver.clean(versionSpec) || '';
|
||||
core.debug(`isExplicit: ${c}`);
|
||||
const valid = semver.valid(c) != null;
|
||||
core.debug(`explicit? ${valid}`);
|
||||
return valid;
|
||||
}
|
||||
function _evaluateVersions(versions, versionSpec) {
|
||||
exports.isExplicitVersion = isExplicitVersion;
|
||||
/**
|
||||
* Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
|
||||
*
|
||||
* @param versions array of versions to evaluate
|
||||
* @param versionSpec semantic version spec to satisfy
|
||||
*/
|
||||
function evaluateVersions(versions, versionSpec) {
|
||||
let version = '';
|
||||
core.debug(`evaluating ${versions.length} versions`);
|
||||
versions = versions.sort((a, b) => {
|
||||
|
@ -11115,6 +11246,7 @@ function _evaluateVersions(versions, versionSpec) {
|
|||
}
|
||||
return version;
|
||||
}
|
||||
exports.evaluateVersions = evaluateVersions;
|
||||
/**
|
||||
* Gets RUNNER_TOOL_CACHE
|
||||
*/
|
||||
|
@ -14771,7 +14903,119 @@ exports.isTokenCredential = isTokenCredential;
|
|||
/***/ }),
|
||||
/* 230 */,
|
||||
/* 231 */,
|
||||
/* 232 */,
|
||||
/* 232 */
|
||||
/***/ (function(__unusedmodule, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.graalToJdk = void 0;
|
||||
exports.graalToJdk = {
|
||||
'22.0.0.2': {
|
||||
'11': '11.0.14',
|
||||
'17': '17.0.2'
|
||||
},
|
||||
'20.3.5': {
|
||||
'11': '11.0.14'
|
||||
},
|
||||
'21.3.1': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.14',
|
||||
'17': '17.0.2'
|
||||
},
|
||||
'20.3.4': {
|
||||
'11': '11.0.13'
|
||||
},
|
||||
'21.3.0': {
|
||||
'11': '11.0.13',
|
||||
'17': '17.0.1'
|
||||
},
|
||||
'21.2.0': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.12',
|
||||
'16': '16.0.2'
|
||||
},
|
||||
'20.3.3': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.12'
|
||||
},
|
||||
'19.3.6': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11'
|
||||
},
|
||||
'20.3.2': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11'
|
||||
},
|
||||
'21.1.0': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11',
|
||||
'16': '16.0.1'
|
||||
},
|
||||
'21.0.0.2': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.1.2': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'21.0.0': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.1': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'19.3.5': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.0': {
|
||||
'8': '8.0.272',
|
||||
'11': '11.0.9'
|
||||
},
|
||||
'19.3.4': {
|
||||
'8': '8.0.272',
|
||||
'11': '11.0.9'
|
||||
},
|
||||
'20.2.0': {
|
||||
'8': '8.0.262',
|
||||
'11': '11.0.8'
|
||||
},
|
||||
'19.3.3': {
|
||||
'8': '8.0.262',
|
||||
'11': '11.0.8'
|
||||
},
|
||||
'20.1.0': {
|
||||
'8': '8.0.252',
|
||||
'11': '11.0.7'
|
||||
},
|
||||
'19.3.2': {
|
||||
'8': '8.0.252',
|
||||
'11': '11.0.7'
|
||||
},
|
||||
'20.0.0': {
|
||||
'8': '8.0.242',
|
||||
'11': '11.0.6'
|
||||
},
|
||||
'19.3.1': {
|
||||
'8': '8.0.242',
|
||||
'11': '11.0.6'
|
||||
},
|
||||
'19.3.0.2': {
|
||||
'8': '8.0.232',
|
||||
'11': '11.0.5'
|
||||
},
|
||||
'19.3.0': {
|
||||
'8': '8.0.232',
|
||||
'11': '11.0.5'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 233 */,
|
||||
/* 234 */,
|
||||
/* 235 */,
|
||||
|
@ -26401,7 +26645,194 @@ exports.ProxyTracer = ProxyTracer;
|
|||
/* 399 */,
|
||||
/* 400 */,
|
||||
/* 401 */,
|
||||
/* 402 */,
|
||||
/* 402 */
|
||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GraalVMDistribution = void 0;
|
||||
const tc = __importStar(__webpack_require__(139));
|
||||
const fs_1 = __importDefault(__webpack_require__(747));
|
||||
const path_1 = __importDefault(__webpack_require__(622));
|
||||
const semver = __importStar(__webpack_require__(876));
|
||||
const base_installer_1 = __webpack_require__(83);
|
||||
const version_mapping_1 = __webpack_require__(232);
|
||||
const util_1 = __webpack_require__(322);
|
||||
const releasesUrl = 'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases';
|
||||
const jvmAssetRegex = /^graalvm-ce-java(?<javaMajor>\d\d?)-(?<platform>darwin|linux|windows)-(?<arch>amd64|aarch64)-.*(?:\.tar\.gz|\.zip)$/;
|
||||
const nextPageRelRegex = /<(?<nextPage>[^>]*?)>; rel="next"/i;
|
||||
class GraalVMDistribution extends base_installer_1.JavaBase {
|
||||
constructor(installerOptions) {
|
||||
super('GraalVM', installerOptions);
|
||||
}
|
||||
getNextPage(headers) {
|
||||
var _a, _b;
|
||||
const link = headers.link;
|
||||
const nextPage = (_b = (_a = link === null || link === void 0 ? void 0 : link.match(nextPageRelRegex)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.nextPage;
|
||||
return nextPage !== null && nextPage !== void 0 ? nextPage : null;
|
||||
}
|
||||
getPaginatedResult(url) {
|
||||
var _a, _b;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const results = [];
|
||||
let res = yield this.http.getJson(url);
|
||||
results.push(...((_a = res.result) !== null && _a !== void 0 ? _a : []));
|
||||
let nextPage = this.getNextPage(res.headers);
|
||||
while (nextPage) {
|
||||
res = yield this.http.getJson(nextPage);
|
||||
results.push(...((_b = res.result) !== null && _b !== void 0 ? _b : []));
|
||||
nextPage = this.getNextPage(res.headers);
|
||||
}
|
||||
return results;
|
||||
});
|
||||
}
|
||||
matchJvmAsset(asset, graalVersion) {
|
||||
var _a;
|
||||
const { url, name } = asset;
|
||||
const match = name.match(jvmAssetRegex);
|
||||
if (match === null || match === void 0 ? void 0 : match.groups) {
|
||||
const { javaMajor, platform, arch } = match.groups;
|
||||
const javaVersion = (_a = version_mapping_1.graalToJdk === null || version_mapping_1.graalToJdk === void 0 ? void 0 : version_mapping_1.graalToJdk[graalVersion]) === null || _a === void 0 ? void 0 : _a[javaMajor];
|
||||
if (javaVersion) {
|
||||
return {
|
||||
type: 'jvm',
|
||||
javaVersion,
|
||||
graalVersion,
|
||||
platform: platform,
|
||||
arch: arch,
|
||||
url
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getPlatform(platform = process.platform) {
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
return 'darwin';
|
||||
case 'win32':
|
||||
case 'cygwin':
|
||||
return 'windows';
|
||||
case 'linux':
|
||||
return 'linux';
|
||||
default:
|
||||
throw new Error(`Unsupported platform: '${platform}'`);
|
||||
}
|
||||
}
|
||||
getArchitectureOptions() {
|
||||
switch (this.architecture) {
|
||||
case 'x86':
|
||||
case 'x64':
|
||||
return 'amd64';
|
||||
case 'armv7':
|
||||
case 'aarch64':
|
||||
return 'aarch64';
|
||||
default:
|
||||
throw new Error(`Unsupported architecture: '${this.architecture}'`);
|
||||
}
|
||||
}
|
||||
getSuggestions(range) {
|
||||
const result = [];
|
||||
const [javaMajor] = range.split('.');
|
||||
for (const [graalVersion, m] of Object.entries(version_mapping_1.graalToJdk)) {
|
||||
const javaVersion = m[javaMajor];
|
||||
if (javaVersion) {
|
||||
result.push(`${javaVersion}+${graalVersion}`);
|
||||
}
|
||||
}
|
||||
return result.sort((x, y) => -semver.compareBuild(x, y));
|
||||
}
|
||||
findPackageForDownload(range) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const [javaVersion, graalVersion] = range.split('+');
|
||||
const platform = this.getPlatform();
|
||||
const arch = this.getArchitectureOptions();
|
||||
const releases = yield this.getPaginatedResult(releasesUrl);
|
||||
const graalAssets = [];
|
||||
for (const release of releases) {
|
||||
const assetGraalVersion = release.tag_name.replace(/^vm-/, '');
|
||||
for (const asset of release.assets) {
|
||||
const graalvmAsset = this.matchJvmAsset(asset, assetGraalVersion);
|
||||
if (graalvmAsset &&
|
||||
graalvmAsset.platform === platform &&
|
||||
graalvmAsset.arch === arch &&
|
||||
util_1.isVersionSatisfies(javaVersion, graalvmAsset.javaVersion)) {
|
||||
if (!graalVersion || graalVersion === graalvmAsset.graalVersion) {
|
||||
graalAssets.push(graalvmAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
graalAssets.sort((x, y) => {
|
||||
return -semver.compareBuild(`${x.javaVersion}+${x.graalVersion}`, `${y.javaVersion}+${y.graalVersion}`);
|
||||
});
|
||||
const [resolved] = graalAssets;
|
||||
if (!resolved) {
|
||||
const msg = `Could not find GraalVM with java ${range}.`;
|
||||
const suggested = this.getSuggestions(javaVersion);
|
||||
const errorMsg = suggested.length
|
||||
? [msg, 'Available versions:', ...suggested].join('\n')
|
||||
: msg;
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
return {
|
||||
url: resolved.url,
|
||||
version: `${resolved.javaVersion}+${resolved.graalVersion}`
|
||||
};
|
||||
});
|
||||
}
|
||||
downloadTool(javaRelease) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const token = process.env.GITHUB_TOKEN;
|
||||
const assetPath = yield tc.downloadTool(javaRelease.url, undefined, token, {
|
||||
accept: 'application/octet-stream'
|
||||
});
|
||||
const ext = this.getPlatform() === 'windows' ? 'zip' : 'tar.gz';
|
||||
const extractedJavaPath = yield util_1.extractJdkFile(assetPath, ext);
|
||||
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
|
||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.GraalVMDistribution = GraalVMDistribution;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 403 */,
|
||||
/* 404 */,
|
||||
/* 405 */,
|
||||
|
@ -52583,6 +53014,25 @@ var __createBinding;
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -52594,9 +53044,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const assert_1 = __webpack_require__(357);
|
||||
const fs = __webpack_require__(747);
|
||||
const path = __webpack_require__(622);
|
||||
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
|
||||
const fs = __importStar(__webpack_require__(747));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
|
||||
exports.IS_WINDOWS = process.platform === 'win32';
|
||||
function exists(fsPath) {
|
||||
|
@ -52637,49 +53087,6 @@ function isRooted(p) {
|
|||
return p.startsWith('/');
|
||||
}
|
||||
exports.isRooted = isRooted;
|
||||
/**
|
||||
* Recursively create a directory at `fsPath`.
|
||||
*
|
||||
* This implementation is optimistic, meaning it attempts to create the full
|
||||
* path first, and backs up the path stack from there.
|
||||
*
|
||||
* @param fsPath The path to create
|
||||
* @param maxDepth The maximum recursion depth
|
||||
* @param depth The current recursion depth
|
||||
*/
|
||||
function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
assert_1.ok(fsPath, 'a path argument must be provided');
|
||||
fsPath = path.resolve(fsPath);
|
||||
if (depth >= maxDepth)
|
||||
return exports.mkdir(fsPath);
|
||||
try {
|
||||
yield exports.mkdir(fsPath);
|
||||
return;
|
||||
}
|
||||
catch (err) {
|
||||
switch (err.code) {
|
||||
case 'ENOENT': {
|
||||
yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
|
||||
yield exports.mkdir(fsPath);
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
let stats;
|
||||
try {
|
||||
stats = yield exports.stat(fsPath);
|
||||
}
|
||||
catch (err2) {
|
||||
throw err;
|
||||
}
|
||||
if (!stats.isDirectory())
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.mkdirP = mkdirP;
|
||||
/**
|
||||
* Best effort attempt to determine whether a file exists and is executable.
|
||||
* @param filePath file path to check
|
||||
|
@ -52776,6 +53183,12 @@ function isUnixExecutable(stats) {
|
|||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
|
||||
((stats.mode & 64) > 0 && stats.uid === process.getuid()));
|
||||
}
|
||||
// Get the path of cmd.exe in windows
|
||||
function getCmdPath() {
|
||||
var _a;
|
||||
return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
|
||||
}
|
||||
exports.getCmdPath = getCmdPath;
|
||||
//# sourceMappingURL=io-util.js.map
|
||||
|
||||
/***/ }),
|
||||
|
@ -56140,6 +56553,7 @@ const installer_3 = __webpack_require__(584);
|
|||
const installer_4 = __webpack_require__(439);
|
||||
const installer_5 = __webpack_require__(507);
|
||||
const installer_6 = __webpack_require__(196);
|
||||
const installer_7 = __webpack_require__(402);
|
||||
var JavaDistribution;
|
||||
(function (JavaDistribution) {
|
||||
JavaDistribution["Adopt"] = "adopt";
|
||||
|
@ -56150,6 +56564,7 @@ var JavaDistribution;
|
|||
JavaDistribution["Liberica"] = "liberica";
|
||||
JavaDistribution["JdkFile"] = "jdkfile";
|
||||
JavaDistribution["Microsoft"] = "microsoft";
|
||||
JavaDistribution["GraalVM"] = "graalvm";
|
||||
})(JavaDistribution || (JavaDistribution = {}));
|
||||
function getJavaDistribution(distributionName, installerOptions, jdkFile) {
|
||||
switch (distributionName) {
|
||||
|
@ -56168,6 +56583,8 @@ function getJavaDistribution(distributionName, installerOptions, jdkFile) {
|
|||
return new installer_5.LibericaDistributions(installerOptions);
|
||||
case JavaDistribution.Microsoft:
|
||||
return new installer_6.MicrosoftDistributions(installerOptions);
|
||||
case JavaDistribution.GraalVM:
|
||||
return new installer_7.GraalVMDistribution(installerOptions);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -100086,6 +100503,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
|
@ -100095,14 +100531,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RetryHelper = void 0;
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
/**
|
||||
* Internal class for retries
|
||||
|
|
6671
package-lock.json
generated
6671
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -30,7 +30,7 @@
|
|||
"@actions/glob": "^0.2.0",
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@actions/io": "^1.0.2",
|
||||
"@actions/tool-cache": "^1.6.1",
|
||||
"@actions/tool-cache": "^1.7.1",
|
||||
"semver": "^7.3.4",
|
||||
"xmlbuilder2": "^2.4.0"
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@ import { AdoptDistribution, AdoptImplementation } from './adopt/installer';
|
|||
import { TemurinDistribution, TemurinImplementation } from './temurin/installer';
|
||||
import { LibericaDistributions } from './liberica/installer';
|
||||
import { MicrosoftDistributions } from './microsoft/installer';
|
||||
import { GraalVMDistribution } from './graalvm/installer';
|
||||
|
||||
enum JavaDistribution {
|
||||
Adopt = 'adopt',
|
||||
|
@ -15,7 +16,8 @@ enum JavaDistribution {
|
|||
Zulu = 'zulu',
|
||||
Liberica = 'liberica',
|
||||
JdkFile = 'jdkfile',
|
||||
Microsoft = 'microsoft'
|
||||
Microsoft = 'microsoft',
|
||||
GraalVM = 'graalvm'
|
||||
}
|
||||
|
||||
export function getJavaDistribution(
|
||||
|
@ -39,6 +41,8 @@ export function getJavaDistribution(
|
|||
return new LibericaDistributions(installerOptions);
|
||||
case JavaDistribution.Microsoft:
|
||||
return new MicrosoftDistributions(installerOptions);
|
||||
case JavaDistribution.GraalVM:
|
||||
return new GraalVMDistribution(installerOptions);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
179
src/distributions/graalvm/installer.ts
Normal file
179
src/distributions/graalvm/installer.ts
Normal file
|
@ -0,0 +1,179 @@
|
|||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||
import * as semver from 'semver';
|
||||
import { JavaBase } from '../base-installer';
|
||||
import {
|
||||
GraalArchitecture,
|
||||
GraalPlatform,
|
||||
IGithubAsset,
|
||||
IGithubRelease,
|
||||
IGraalAsset
|
||||
} from './models';
|
||||
import { graalToJdk } from './version-mapping';
|
||||
import { extractJdkFile, isVersionSatisfies } from '../../util';
|
||||
|
||||
const releasesUrl = 'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases';
|
||||
|
||||
const jvmAssetRegex = /^graalvm-ce-java(?<javaMajor>\d\d?)-(?<platform>darwin|linux|windows)-(?<arch>amd64|aarch64)-.*(?:\.tar\.gz|\.zip)$/;
|
||||
const nextPageRelRegex = /<(?<nextPage>[^>]*?)>; rel="next"/i;
|
||||
|
||||
export class GraalVMDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('GraalVM', installerOptions);
|
||||
}
|
||||
|
||||
private getNextPage(headers: Object): string | null {
|
||||
const link = (headers as Record<string, string>).link;
|
||||
const nextPage = link?.match(nextPageRelRegex)?.groups?.nextPage;
|
||||
return nextPage ?? null;
|
||||
}
|
||||
|
||||
private async getPaginatedResult<T = IGithubRelease>(url: string): Promise<T[]> {
|
||||
const results: T[] = [];
|
||||
|
||||
let res = await this.http.getJson<T[]>(url);
|
||||
results.push(...(res.result ?? []));
|
||||
let nextPage = this.getNextPage(res.headers);
|
||||
|
||||
while (nextPage) {
|
||||
res = await this.http.getJson<T[]>(nextPage);
|
||||
results.push(...(res.result ?? []));
|
||||
nextPage = this.getNextPage(res.headers);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
private matchJvmAsset(asset: IGithubAsset, graalVersion: string): IGraalAsset | null {
|
||||
const { url, name } = asset;
|
||||
const match = name.match(jvmAssetRegex);
|
||||
if (match?.groups) {
|
||||
const { javaMajor, platform, arch } = match.groups;
|
||||
const javaVersion = graalToJdk?.[graalVersion]?.[javaMajor];
|
||||
|
||||
if (javaVersion) {
|
||||
return {
|
||||
type: 'jvm',
|
||||
javaVersion,
|
||||
graalVersion,
|
||||
platform: platform as GraalPlatform,
|
||||
arch: arch as GraalArchitecture,
|
||||
url
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private getPlatform(platform: NodeJS.Platform = process.platform): GraalPlatform {
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
return 'darwin';
|
||||
case 'win32':
|
||||
case 'cygwin':
|
||||
return 'windows';
|
||||
case 'linux':
|
||||
return 'linux';
|
||||
default:
|
||||
throw new Error(`Unsupported platform: '${platform}'`);
|
||||
}
|
||||
}
|
||||
|
||||
private getArchitectureOptions(): GraalArchitecture {
|
||||
switch (this.architecture) {
|
||||
case 'x86':
|
||||
case 'x64':
|
||||
return 'amd64';
|
||||
case 'armv7':
|
||||
case 'aarch64':
|
||||
return 'aarch64';
|
||||
default:
|
||||
throw new Error(`Unsupported architecture: '${this.architecture}'`);
|
||||
}
|
||||
}
|
||||
|
||||
private getSuggestions(range: string): string[] {
|
||||
const result: string[] = [];
|
||||
const [javaMajor] = range.split('.');
|
||||
for (const [graalVersion, m] of Object.entries(graalToJdk)) {
|
||||
const javaVersion = m[javaMajor];
|
||||
if (javaVersion) {
|
||||
result.push(`${javaVersion}+${graalVersion}`);
|
||||
}
|
||||
}
|
||||
return result.sort((x, y) => -semver.compareBuild(x, y));
|
||||
}
|
||||
|
||||
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||
const [javaVersion, graalVersion] = range.split('+');
|
||||
|
||||
const platform = this.getPlatform();
|
||||
const arch = this.getArchitectureOptions();
|
||||
|
||||
const releases = await this.getPaginatedResult(releasesUrl);
|
||||
|
||||
const graalAssets: IGraalAsset[] = [];
|
||||
for (const release of releases) {
|
||||
const assetGraalVersion = release.tag_name.replace(/^vm-/, '');
|
||||
for (const asset of release.assets) {
|
||||
const graalvmAsset = this.matchJvmAsset(asset, assetGraalVersion);
|
||||
if (
|
||||
graalvmAsset &&
|
||||
graalvmAsset.platform === platform &&
|
||||
graalvmAsset.arch === arch &&
|
||||
isVersionSatisfies(javaVersion, graalvmAsset.javaVersion)
|
||||
) {
|
||||
if (!graalVersion || graalVersion === graalvmAsset.graalVersion) {
|
||||
graalAssets.push(graalvmAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
graalAssets.sort((x, y) => {
|
||||
return -semver.compareBuild(
|
||||
`${x.javaVersion}+${x.graalVersion}`,
|
||||
`${y.javaVersion}+${y.graalVersion}`
|
||||
);
|
||||
});
|
||||
|
||||
const [resolved] = graalAssets;
|
||||
if (!resolved) {
|
||||
const msg = `Could not find GraalVM with java ${range}.`;
|
||||
const suggested = this.getSuggestions(javaVersion);
|
||||
const errorMsg = suggested.length
|
||||
? [msg, 'Available versions:', ...suggested].join('\n')
|
||||
: msg;
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
|
||||
return {
|
||||
url: resolved.url,
|
||||
version: `${resolved.javaVersion}+${resolved.graalVersion}`
|
||||
};
|
||||
}
|
||||
|
||||
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||
const token = process.env.GITHUB_TOKEN;
|
||||
const assetPath = await tc.downloadTool(javaRelease.url, undefined, token, {
|
||||
accept: 'application/octet-stream'
|
||||
});
|
||||
const ext = this.getPlatform() === 'windows' ? 'zip' : 'tar.gz';
|
||||
const extractedJavaPath = await extractJdkFile(assetPath, ext);
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||
|
||||
const javaPath = await tc.cacheDir(
|
||||
archivePath,
|
||||
this.toolcacheFolderName,
|
||||
version,
|
||||
this.architecture
|
||||
);
|
||||
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
}
|
||||
}
|
29
src/distributions/graalvm/models.ts
Normal file
29
src/distributions/graalvm/models.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Models from https://docs.github.com/en/rest/reference/releases#list-releases
|
||||
|
||||
export interface IGithubAsset {
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface IGithubRelease {
|
||||
name: string;
|
||||
tag_name: string;
|
||||
draft: boolean;
|
||||
prereleaes: boolean;
|
||||
assets: IGithubAsset[];
|
||||
}
|
||||
|
||||
export type GraalAssetType = 'jvm' | 'espresso' | 'llvm-toolchain' | 'native-image' | 'wasm';
|
||||
|
||||
export type GraalPlatform = 'darwin' | 'linux' | 'windows';
|
||||
|
||||
export type GraalArchitecture = 'amd64' | 'aarch64';
|
||||
|
||||
export interface IGraalAsset {
|
||||
type: GraalAssetType;
|
||||
javaVersion: string;
|
||||
graalVersion: string;
|
||||
platform: GraalPlatform;
|
||||
arch: GraalArchitecture;
|
||||
url: string;
|
||||
}
|
103
src/distributions/graalvm/version-mapping.ts
Normal file
103
src/distributions/graalvm/version-mapping.ts
Normal file
|
@ -0,0 +1,103 @@
|
|||
export const graalToJdk: Record<string, Record<string, string>> = {
|
||||
'22.0.0.2': {
|
||||
'11': '11.0.14',
|
||||
'17': '17.0.2'
|
||||
},
|
||||
'20.3.5': {
|
||||
'11': '11.0.14'
|
||||
},
|
||||
'21.3.1': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.14',
|
||||
'17': '17.0.2'
|
||||
},
|
||||
'20.3.4': {
|
||||
'11': '11.0.13'
|
||||
},
|
||||
'21.3.0': {
|
||||
'11': '11.0.13',
|
||||
'17': '17.0.1'
|
||||
},
|
||||
'21.2.0': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.12',
|
||||
'16': '16.0.2'
|
||||
},
|
||||
'20.3.3': {
|
||||
'8': '8.0.302',
|
||||
'11': '11.0.12'
|
||||
},
|
||||
'19.3.6': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11'
|
||||
},
|
||||
'20.3.2': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11'
|
||||
},
|
||||
'21.1.0': {
|
||||
'8': '8.0.292',
|
||||
'11': '11.0.11',
|
||||
'16': '16.0.1'
|
||||
},
|
||||
'21.0.0.2': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.1.2': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'21.0.0': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.1': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'19.3.5': {
|
||||
'8': '8.0.282',
|
||||
'11': '11.0.10'
|
||||
},
|
||||
'20.3.0': {
|
||||
'8': '8.0.272',
|
||||
'11': '11.0.9'
|
||||
},
|
||||
'19.3.4': {
|
||||
'8': '8.0.272',
|
||||
'11': '11.0.9'
|
||||
},
|
||||
'20.2.0': {
|
||||
'8': '8.0.262',
|
||||
'11': '11.0.8'
|
||||
},
|
||||
'19.3.3': {
|
||||
'8': '8.0.262',
|
||||
'11': '11.0.8'
|
||||
},
|
||||
'20.1.0': {
|
||||
'8': '8.0.252',
|
||||
'11': '11.0.7'
|
||||
},
|
||||
'19.3.2': {
|
||||
'8': '8.0.252',
|
||||
'11': '11.0.7'
|
||||
},
|
||||
'20.0.0': {
|
||||
'8': '8.0.242',
|
||||
'11': '11.0.6'
|
||||
},
|
||||
'19.3.1': {
|
||||
'8': '8.0.242',
|
||||
'11': '11.0.6'
|
||||
},
|
||||
'19.3.0.2': {
|
||||
'8': '8.0.232',
|
||||
'11': '11.0.5'
|
||||
},
|
||||
'19.3.0': {
|
||||
'8': '8.0.232',
|
||||
'11': '11.0.5'
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue