mirror of
https://github.com/actions/setup-python
synced 2025-04-05 06:49:43 +00:00
Fix: Add .zip
extension to Windows package downloads for Expand-Archive
Compatibility (#916)
* Fix: specify filename during Windows package download * Changed unit test download urls
This commit is contained in:
22
dist/setup/index.js
vendored
22
dist/setup/index.js
vendored
@ -91441,7 +91441,8 @@ function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases,
|
||||
const downloadUrl = `${foundAsset.download_url}`;
|
||||
core.info(`Downloading PyPy from "${downloadUrl}" ...`);
|
||||
try {
|
||||
const pypyPath = yield tc.downloadTool(downloadUrl);
|
||||
const fileName = (0, utils_1.getDownloadFileName)(downloadUrl);
|
||||
const pypyPath = yield tc.downloadTool(downloadUrl, fileName);
|
||||
core.info('Extracting downloaded archive...');
|
||||
if (utils_1.IS_WINDOWS) {
|
||||
downloadDir = yield tc.extractZip(pypyPath);
|
||||
@ -91703,7 +91704,8 @@ function installCpythonFromRelease(release) {
|
||||
core.info(`Download from "${downloadUrl}"`);
|
||||
let pythonPath = '';
|
||||
try {
|
||||
pythonPath = yield tc.downloadTool(downloadUrl, undefined, AUTH);
|
||||
const fileName = (0, utils_1.getDownloadFileName)(downloadUrl);
|
||||
pythonPath = yield tc.downloadTool(downloadUrl, fileName, AUTH);
|
||||
core.info('Extract downloaded archive');
|
||||
let pythonExtractedFolder;
|
||||
if (utils_1.IS_WINDOWS) {
|
||||
@ -91938,7 +91940,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getNextPageUrl = exports.getBinaryDirectory = exports.getVersionInputFromFile = exports.getVersionInputFromPlainFile = exports.getVersionInputFromTomlFile = exports.getOSInfo = exports.getLinuxInfo = exports.logWarning = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_MAC = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
|
||||
exports.getDownloadFileName = exports.getNextPageUrl = exports.getBinaryDirectory = exports.getVersionInputFromFile = exports.getVersionInputFromPlainFile = exports.getVersionInputFromTomlFile = exports.getOSInfo = exports.getLinuxInfo = exports.logWarning = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_MAC = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
|
||||
/* eslint no-unsafe-finally: "off" */
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
@ -92198,6 +92200,20 @@ function getNextPageUrl(response) {
|
||||
return null;
|
||||
}
|
||||
exports.getNextPageUrl = getNextPageUrl;
|
||||
/**
|
||||
* Add temporary fix for Windows
|
||||
* On Windows, it is necessary to retain the .zip extension for proper extraction.
|
||||
* because the tc.extractZip() failure due to tc.downloadTool() not adding .zip extension.
|
||||
* Related issue: https://github.com/actions/toolkit/issues/1179
|
||||
* Related issue: https://github.com/actions/setup-python/issues/819
|
||||
*/
|
||||
function getDownloadFileName(downloadUrl) {
|
||||
const tempDir = process.env.RUNNER_TEMP || '.';
|
||||
return exports.IS_WINDOWS
|
||||
? path.join(tempDir, path.basename(downloadUrl))
|
||||
: undefined;
|
||||
}
|
||||
exports.getDownloadFileName = getDownloadFileName;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
Reference in New Issue
Block a user