Use explicit filename when downloading Windows go package

Using the explicit filename for Windows is necessary to
satisfy `Expand-Archive`'s requirement on '.zip' extension.

Signed-off-by: Javier Romero <root@jromero.codes>
This commit is contained in:
Javier Romero
2022-07-28 17:22:06 -05:00
parent f2e56d8191
commit e0dce94eb0
3 changed files with 52 additions and 2 deletions

6
dist/setup/index.js vendored
View File

@ -62942,7 +62942,11 @@ function resolveVersionFromManifest(versionSpec, stable, auth) {
function installGoVersion(info, auth) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
const downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth);
// Windows requires that we keep the extension (.zip) for extraction
const isWindows = os_1.default.platform() === 'win32';
const tempDir = process.env.RUNNER_TEMP || '.';
const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined;
const downloadPath = yield tc.downloadTool(info.downloadUrl, fileName, auth);
core.info('Extracting Go...');
let extPath = yield extractGoArchive(downloadPath);
core.info(`Successfully extracted go to ${extPath}`);