From 48e7cabb7c3869433dc5b78faad808e7cf4cbfb6 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 12 Dec 2022 21:43:25 +0100 Subject: [PATCH] Try download with extension. --- dist/main/index.js | 6 +++++- src/graalvm.ts | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 1cdcc9c..427e5f6 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -18568,9 +18568,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setUpGraalVMRelease = exports.setUpGraalVMDevBuild = exports.getLatestReleaseVersion = exports.setUpGraalVMLatest = void 0; const c = __importStar(__nccwpck_require__(9042)); +const path_1 = __nccwpck_require__(1017); const utils_1 = __nccwpck_require__(1314); const gds_1 = __nccwpck_require__(9543); const tool_cache_1 = __nccwpck_require__(7784); +const uuid_1 = __nccwpck_require__(5840); const GRAALVM_CE_DL_BASE = 'https://github.com/graalvm/graalvm-ce-builds/releases/download'; const GRAALVM_REPO_DEV_BUILDS = 'graalvm-ce-dev-builds'; const GRAALVM_REPO_RELEASES = 'graalvm-ce-builds'; @@ -18624,7 +18626,9 @@ function setUpGraalVMRelease(gdsToken, version, javaVersion) { } else { const downloadUrl = `${GRAALVM_CE_DL_BASE}/${GRAALVM_TAG_PREFIX}${version}/${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`; - downloader = () => __awaiter(this, void 0, void 0, function* () { return tool_cache_1.downloadTool(downloadUrl); }); + downloader = () => __awaiter(this, void 0, void 0, function* () { + return tool_cache_1.downloadTool(downloadUrl, path_1.join(process.env['RUNNER_TEMP'] || '', `${uuid_1.v4()}${c.GRAALVM_FILE_EXTENSION}`)); + }); } return utils_1.downloadExtractAndCacheJDK(downloader, toolName, version); }); diff --git a/src/graalvm.ts b/src/graalvm.ts index 577e612..d86731c 100644 --- a/src/graalvm.ts +++ b/src/graalvm.ts @@ -1,4 +1,5 @@ import * as c from './constants' +import {join} from 'path' import { downloadAndExtractJDK, downloadExtractAndCacheJDK, @@ -6,6 +7,7 @@ import { } from './utils' import {downloadGraalVMEE} from './gds' import {downloadTool} from '@actions/tool-cache' +import {v4 as uuidv4} from 'uuid' const GRAALVM_CE_DL_BASE = 'https://github.com/graalvm/graalvm-ce-builds/releases/download' @@ -74,7 +76,14 @@ export async function setUpGraalVMRelease( downloader = async () => downloadGraalVMEE(gdsToken, version, javaVersion) } else { const downloadUrl = `${GRAALVM_CE_DL_BASE}/${GRAALVM_TAG_PREFIX}${version}/${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}` - downloader = async () => downloadTool(downloadUrl) + downloader = async () => + downloadTool( + downloadUrl, + join( + process.env['RUNNER_TEMP'] || '', + `${uuidv4()}${c.GRAALVM_FILE_EXTENSION}` + ) + ) } return downloadExtractAndCacheJDK(downloader, toolName, version) }