|
|
@@ -205,7 +205,8 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
|
|
|
|
// restore cache & install
|
|
|
|
// restore cache & install
|
|
|
|
let cachedKey = null
|
|
|
|
let cachedKey = null
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
|
|
|
|
// .slice() to workaround https://github.com/actions/toolkit/issues/1377
|
|
|
|
|
|
|
|
cachedKey = await cache.restoreCache(paths.slice(), key, restoreKeys)
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
if (error.name === cache.ValidationError.name) {
|
|
|
|
if (error.name === cache.ValidationError.name) {
|
|
|
|
throw error;
|
|
|
|
throw error;
|
|
|
@@ -249,7 +250,7 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|
|
|
const cwd = process.cwd()
|
|
|
|
const cwd = process.cwd()
|
|
|
|
const bundleWith = process.env['BUNDLE_WITH'] || ''
|
|
|
|
const bundleWith = process.env['BUNDLE_WITH'] || ''
|
|
|
|
const bundleWithout = process.env['BUNDLE_WITHOUT'] || ''
|
|
|
|
const bundleWithout = process.env['BUNDLE_WITHOUT'] || ''
|
|
|
|
let key = `setup-ruby-bundler-cache-v5-${common.getOSNameVersionArch()}-${engine}-${version}-wd-${cwd}-with-${bundleWith}-without-${bundleWithout}`
|
|
|
|
let key = `setup-ruby-bundler-cache-v6-${common.getOSNameVersionArch()}-${engine}-${version}-wd-${cwd}-with-${bundleWith}-without-${bundleWithout}`
|
|
|
|
|
|
|
|
|
|
|
|
if (cacheVersion !== DEFAULT_CACHE_VERSION) {
|
|
|
|
if (cacheVersion !== DEFAULT_CACHE_VERSION) {
|
|
|
|
key += `-v-${cacheVersion}`
|
|
|
|
key += `-v-${cacheVersion}`
|
|
|
@@ -725,6 +726,29 @@ function setupPath(newPathEntries) {
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -734,14 +758,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const path = __importStar(__nccwpck_require__(1017));
|
|
|
|
const path = __importStar(__nccwpck_require__(1017));
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
@@ -793,9 +811,10 @@ exports.isFeatureAvailable = isFeatureAvailable;
|
|
|
|
* @param primaryKey an explicit key for restoring the cache
|
|
|
|
* @param primaryKey an explicit key for restoring the cache
|
|
|
|
* @param restoreKeys an optional ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
|
|
|
* @param restoreKeys an optional ordered list of keys to use for restoring the cache if no cache hit occurred for key
|
|
|
|
* @param downloadOptions cache download options
|
|
|
|
* @param downloadOptions cache download options
|
|
|
|
|
|
|
|
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
|
|
|
* @returns string returns the key for the cache hit, otherwise returns undefined
|
|
|
|
* @returns string returns the key for the cache hit, otherwise returns undefined
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function restoreCache(paths, primaryKey, restoreKeys, options) {
|
|
|
|
function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
checkPaths(paths);
|
|
|
|
checkPaths(paths);
|
|
|
|
restoreKeys = restoreKeys || [];
|
|
|
|
restoreKeys = restoreKeys || [];
|
|
|
@@ -813,22 +832,27 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// path are needed to compute version
|
|
|
|
// path are needed to compute version
|
|
|
|
const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
|
|
|
|
const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {
|
|
|
|
compressionMethod
|
|
|
|
compressionMethod,
|
|
|
|
|
|
|
|
enableCrossOsArchive
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
|
|
|
|
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {
|
|
|
|
// Cache not found
|
|
|
|
// Cache not found
|
|
|
|
return undefined;
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
|
|
|
|
|
|
|
core.info('Lookup only - skipping download');
|
|
|
|
|
|
|
|
return cacheEntry.cacheKey;
|
|
|
|
|
|
|
|
}
|
|
|
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
|
|
|
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
|
|
|
core.debug(`Archive Path: ${archivePath}`);
|
|
|
|
core.debug(`Archive Path: ${archivePath}`);
|
|
|
|
// Download the cache from the cache entry
|
|
|
|
// Download the cache from the cache entry
|
|
|
|
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
|
|
|
|
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
|
|
|
|
if (core.isDebug()) {
|
|
|
|
if (core.isDebug()) {
|
|
|
|
yield tar_1.listTar(archivePath, compressionMethod);
|
|
|
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
|
|
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
|
|
|
yield tar_1.extractTar(archivePath, compressionMethod);
|
|
|
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
|
|
|
core.info('Cache restored successfully');
|
|
|
|
core.info('Cache restored successfully');
|
|
|
|
return cacheEntry.cacheKey;
|
|
|
|
return cacheEntry.cacheKey;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -860,10 +884,11 @@ exports.restoreCache = restoreCache;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param paths a list of file paths to be cached
|
|
|
|
* @param paths a list of file paths to be cached
|
|
|
|
* @param key an explicit key for restoring the cache
|
|
|
|
* @param key an explicit key for restoring the cache
|
|
|
|
|
|
|
|
* @param enableCrossOsArchive an optional boolean enabled to save cache on windows which could be restored on any platform
|
|
|
|
* @param options cache upload options
|
|
|
|
* @param options cache upload options
|
|
|
|
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
|
|
|
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function saveCache(paths, key, options) {
|
|
|
|
function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
|
|
|
var _a, _b, _c, _d, _e;
|
|
|
|
var _a, _b, _c, _d, _e;
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
checkPaths(paths);
|
|
|
|
checkPaths(paths);
|
|
|
@@ -880,9 +905,9 @@ function saveCache(paths, key, options) {
|
|
|
|
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
|
|
|
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
|
|
|
core.debug(`Archive Path: ${archivePath}`);
|
|
|
|
core.debug(`Archive Path: ${archivePath}`);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
|
|
|
|
yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod);
|
|
|
|
if (core.isDebug()) {
|
|
|
|
if (core.isDebug()) {
|
|
|
|
yield tar_1.listTar(archivePath, compressionMethod);
|
|
|
|
yield (0, tar_1.listTar)(archivePath, compressionMethod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
|
|
|
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
|
|
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
@@ -894,6 +919,7 @@ function saveCache(paths, key, options) {
|
|
|
|
core.debug('Reserving Cache');
|
|
|
|
core.debug('Reserving Cache');
|
|
|
|
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
|
|
|
|
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
|
|
|
|
compressionMethod,
|
|
|
|
compressionMethod,
|
|
|
|
|
|
|
|
enableCrossOsArchive,
|
|
|
|
cacheSize: archiveFileSize
|
|
|
|
cacheSize: archiveFileSize
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
|
|
|
|
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
|
|
|
@@ -942,6 +968,29 @@ exports.saveCache = saveCache;
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -951,14 +1000,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const auth_1 = __nccwpck_require__(5526);
|
|
|
|
const auth_1 = __nccwpck_require__(5526);
|
|
|
@@ -966,7 +1009,6 @@ const crypto = __importStar(__nccwpck_require__(6113));
|
|
|
|
const fs = __importStar(__nccwpck_require__(7147));
|
|
|
|
const fs = __importStar(__nccwpck_require__(7147));
|
|
|
|
const url_1 = __nccwpck_require__(7310);
|
|
|
|
const url_1 = __nccwpck_require__(7310);
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
|
const constants_1 = __nccwpck_require__(8840);
|
|
|
|
|
|
|
|
const downloadUtils_1 = __nccwpck_require__(5500);
|
|
|
|
const downloadUtils_1 = __nccwpck_require__(5500);
|
|
|
|
const options_1 = __nccwpck_require__(6215);
|
|
|
|
const options_1 = __nccwpck_require__(6215);
|
|
|
|
const requestUtils_1 = __nccwpck_require__(3981);
|
|
|
|
const requestUtils_1 = __nccwpck_require__(3981);
|
|
|
@@ -996,10 +1038,17 @@ function createHttpClient() {
|
|
|
|
const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token);
|
|
|
|
const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token);
|
|
|
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
|
|
|
return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getCacheVersion(paths, compressionMethod) {
|
|
|
|
function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {
|
|
|
|
const components = paths.concat(!compressionMethod || compressionMethod === constants_1.CompressionMethod.Gzip
|
|
|
|
const components = paths;
|
|
|
|
? []
|
|
|
|
// Add compression method to cache version to restore
|
|
|
|
: [compressionMethod]);
|
|
|
|
// compressed cache as per compression method
|
|
|
|
|
|
|
|
if (compressionMethod) {
|
|
|
|
|
|
|
|
components.push(compressionMethod);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Only check for windows platforms if enableCrossOsArchive is false
|
|
|
|
|
|
|
|
if (process.platform === 'win32' && !enableCrossOsArchive) {
|
|
|
|
|
|
|
|
components.push('windows-only');
|
|
|
|
|
|
|
|
}
|
|
|
|
// Add salt to cache version to support breaking changes in cache entry
|
|
|
|
// Add salt to cache version to support breaking changes in cache entry
|
|
|
|
components.push(versionSalt);
|
|
|
|
components.push(versionSalt);
|
|
|
|
return crypto
|
|
|
|
return crypto
|
|
|
@@ -1011,18 +1060,24 @@ exports.getCacheVersion = getCacheVersion;
|
|
|
|
function getCacheEntry(keys, paths, options) {
|
|
|
|
function getCacheEntry(keys, paths, options) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
|
|
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive);
|
|
|
|
const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
|
|
|
|
const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;
|
|
|
|
const response = yield requestUtils_1.retryTypedResponse('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
|
|
|
|
const response = yield (0, requestUtils_1.retryTypedResponse)('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
|
|
|
|
|
|
|
|
// Cache not found
|
|
|
|
if (response.statusCode === 204) {
|
|
|
|
if (response.statusCode === 204) {
|
|
|
|
|
|
|
|
// List cache for primary key only if cache miss occurs
|
|
|
|
|
|
|
|
if (core.isDebug()) {
|
|
|
|
|
|
|
|
yield printCachesListForDiagnostics(keys[0], httpClient, version);
|
|
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!requestUtils_1.isSuccessStatusCode(response.statusCode)) {
|
|
|
|
if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) {
|
|
|
|
throw new Error(`Cache service responded with ${response.statusCode}`);
|
|
|
|
throw new Error(`Cache service responded with ${response.statusCode}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const cacheResult = response.result;
|
|
|
|
const cacheResult = response.result;
|
|
|
|
const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
|
|
|
|
const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;
|
|
|
|
if (!cacheDownloadUrl) {
|
|
|
|
if (!cacheDownloadUrl) {
|
|
|
|
|
|
|
|
// Cache achiveLocation not found. This should never happen, and hence bail out.
|
|
|
|
throw new Error('Cache not found.');
|
|
|
|
throw new Error('Cache not found.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
core.setSecret(cacheDownloadUrl);
|
|
|
|
core.setSecret(cacheDownloadUrl);
|
|
|
@@ -1032,18 +1087,34 @@ function getCacheEntry(keys, paths, options) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.getCacheEntry = getCacheEntry;
|
|
|
|
exports.getCacheEntry = getCacheEntry;
|
|
|
|
|
|
|
|
function printCachesListForDiagnostics(key, httpClient, version) {
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
const resource = `caches?key=${encodeURIComponent(key)}`;
|
|
|
|
|
|
|
|
const response = yield (0, requestUtils_1.retryTypedResponse)('listCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));
|
|
|
|
|
|
|
|
if (response.statusCode === 200) {
|
|
|
|
|
|
|
|
const cacheListResult = response.result;
|
|
|
|
|
|
|
|
const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount;
|
|
|
|
|
|
|
|
if (totalCount && totalCount > 0) {
|
|
|
|
|
|
|
|
core.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env['GITHUB_REF']}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key \nOther caches with similar key:`);
|
|
|
|
|
|
|
|
for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) {
|
|
|
|
|
|
|
|
core.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
function downloadCache(archiveLocation, archivePath, options) {
|
|
|
|
function downloadCache(archiveLocation, archivePath, options) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const archiveUrl = new url_1.URL(archiveLocation);
|
|
|
|
const archiveUrl = new url_1.URL(archiveLocation);
|
|
|
|
const downloadOptions = options_1.getDownloadOptions(options);
|
|
|
|
const downloadOptions = (0, options_1.getDownloadOptions)(options);
|
|
|
|
if (downloadOptions.useAzureSdk &&
|
|
|
|
if (downloadOptions.useAzureSdk &&
|
|
|
|
archiveUrl.hostname.endsWith('.blob.core.windows.net')) {
|
|
|
|
archiveUrl.hostname.endsWith('.blob.core.windows.net')) {
|
|
|
|
// Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability.
|
|
|
|
// Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability.
|
|
|
|
yield downloadUtils_1.downloadCacheStorageSDK(archiveLocation, archivePath, downloadOptions);
|
|
|
|
yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// Otherwise, download using the Actions http-client.
|
|
|
|
// Otherwise, download using the Actions http-client.
|
|
|
|
yield downloadUtils_1.downloadCacheHttpClient(archiveLocation, archivePath);
|
|
|
|
yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1052,13 +1123,13 @@ exports.downloadCache = downloadCache;
|
|
|
|
function reserveCache(key, paths, options) {
|
|
|
|
function reserveCache(key, paths, options) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
|
|
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive);
|
|
|
|
const reserveCacheRequest = {
|
|
|
|
const reserveCacheRequest = {
|
|
|
|
key,
|
|
|
|
key,
|
|
|
|
version,
|
|
|
|
version,
|
|
|
|
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
|
|
|
|
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const response = yield (0, requestUtils_1.retryTypedResponse)('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
|
|
|
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
@@ -1082,10 +1153,10 @@ function uploadChunk(httpClient, resourceUrl, openStream, start, end) {
|
|
|
|
'Content-Type': 'application/octet-stream',
|
|
|
|
'Content-Type': 'application/octet-stream',
|
|
|
|
'Content-Range': getContentRange(start, end)
|
|
|
|
'Content-Range': getContentRange(start, end)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const uploadChunkResponse = yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders);
|
|
|
|
return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
if (!requestUtils_1.isSuccessStatusCode(uploadChunkResponse.message.statusCode)) {
|
|
|
|
if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) {
|
|
|
|
throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`);
|
|
|
|
throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@@ -1096,7 +1167,7 @@ function uploadFile(httpClient, cacheId, archivePath, options) {
|
|
|
|
const fileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
const fileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`);
|
|
|
|
const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`);
|
|
|
|
const fd = fs.openSync(archivePath, 'r');
|
|
|
|
const fd = fs.openSync(archivePath, 'r');
|
|
|
|
const uploadOptions = options_1.getUploadOptions(options);
|
|
|
|
const uploadOptions = (0, options_1.getUploadOptions)(options);
|
|
|
|
const concurrency = utils.assertDefined('uploadConcurrency', uploadOptions.uploadConcurrency);
|
|
|
|
const concurrency = utils.assertDefined('uploadConcurrency', uploadOptions.uploadConcurrency);
|
|
|
|
const maxChunkSize = utils.assertDefined('uploadChunkSize', uploadOptions.uploadChunkSize);
|
|
|
|
const maxChunkSize = utils.assertDefined('uploadChunkSize', uploadOptions.uploadChunkSize);
|
|
|
|
const parallelUploads = [...new Array(concurrency).keys()];
|
|
|
|
const parallelUploads = [...new Array(concurrency).keys()];
|
|
|
@@ -1131,7 +1202,7 @@ function uploadFile(httpClient, cacheId, archivePath, options) {
|
|
|
|
function commitCache(httpClient, cacheId, filesize) {
|
|
|
|
function commitCache(httpClient, cacheId, filesize) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const commitCacheRequest = { size: filesize };
|
|
|
|
const commitCacheRequest = { size: filesize };
|
|
|
|
return yield requestUtils_1.retryTypedResponse('commitCache', () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return yield (0, requestUtils_1.retryTypedResponse)('commitCache', () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest);
|
|
|
|
return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
|
|
@@ -1146,7 +1217,7 @@ function saveCache(cacheId, archivePath, options) {
|
|
|
|
const cacheSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
const cacheSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
|
|
core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
|
|
|
core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
|
|
|
const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);
|
|
|
|
const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);
|
|
|
|
if (!requestUtils_1.isSuccessStatusCode(commitCacheResponse.statusCode)) {
|
|
|
|
if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) {
|
|
|
|
throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`);
|
|
|
|
throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
core.info('Cache saved successfully');
|
|
|
|
core.info('Cache saved successfully');
|
|
|
@@ -1162,6 +1233,29 @@ exports.saveCache = saveCache;
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -1178,14 +1272,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
|
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
|
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
|
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.isGhes = exports.assertDefined = exports.getGnuTarPathOnWindows = exports.getCacheFileName = exports.getCompressionMethod = exports.unlinkFile = exports.resolvePaths = exports.getArchiveFileSizeInBytes = exports.createTempDirectory = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const exec = __importStar(__nccwpck_require__(1514));
|
|
|
|
const exec = __importStar(__nccwpck_require__(1514));
|
|
|
|
const glob = __importStar(__nccwpck_require__(8090));
|
|
|
|
const glob = __importStar(__nccwpck_require__(8090));
|
|
|
@@ -1217,7 +1305,7 @@ function createTempDirectory() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
|
|
|
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const dest = path.join(tempDirectory, uuid_1.v4());
|
|
|
|
const dest = path.join(tempDirectory, (0, uuid_1.v4)());
|
|
|
|
yield io.mkdirP(dest);
|
|
|
|
yield io.mkdirP(dest);
|
|
|
|
return dest;
|
|
|
|
return dest;
|
|
|
|
});
|
|
|
|
});
|
|
|
@@ -1270,12 +1358,13 @@ function unlinkFile(filePath) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.unlinkFile = unlinkFile;
|
|
|
|
exports.unlinkFile = unlinkFile;
|
|
|
|
function getVersion(app) {
|
|
|
|
function getVersion(app, additionalArgs = []) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
core.debug(`Checking ${app} --version`);
|
|
|
|
|
|
|
|
let versionOutput = '';
|
|
|
|
let versionOutput = '';
|
|
|
|
|
|
|
|
additionalArgs.push('--version');
|
|
|
|
|
|
|
|
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
yield exec.exec(`${app} --version`, [], {
|
|
|
|
yield exec.exec(`${app}`, additionalArgs, {
|
|
|
|
ignoreReturnCode: true,
|
|
|
|
ignoreReturnCode: true,
|
|
|
|
silent: true,
|
|
|
|
silent: true,
|
|
|
|
listeners: {
|
|
|
|
listeners: {
|
|
|
@@ -1295,23 +1384,14 @@ function getVersion(app) {
|
|
|
|
// Use zstandard if possible to maximize cache performance
|
|
|
|
// Use zstandard if possible to maximize cache performance
|
|
|
|
function getCompressionMethod() {
|
|
|
|
function getCompressionMethod() {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
if (process.platform === 'win32' && !(yield isGnuTarInstalled())) {
|
|
|
|
const versionOutput = yield getVersion('zstd', ['--quiet']);
|
|
|
|
// Disable zstd due to bug https://github.com/actions/cache/issues/301
|
|
|
|
|
|
|
|
return constants_1.CompressionMethod.Gzip;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const versionOutput = yield getVersion('zstd');
|
|
|
|
|
|
|
|
const version = semver.clean(versionOutput);
|
|
|
|
const version = semver.clean(versionOutput);
|
|
|
|
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
|
|
|
core.debug(`zstd version: ${version}`);
|
|
|
|
// zstd is not installed
|
|
|
|
if (versionOutput === '') {
|
|
|
|
return constants_1.CompressionMethod.Gzip;
|
|
|
|
return constants_1.CompressionMethod.Gzip;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!version || semver.lt(version, 'v1.3.2')) {
|
|
|
|
|
|
|
|
// zstd is installed but using a version earlier than v1.3.2
|
|
|
|
|
|
|
|
// v1.3.2 is required to use the `--long` options in zstd
|
|
|
|
|
|
|
|
return constants_1.CompressionMethod.ZstdWithoutLong;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return constants_1.CompressionMethod.Zstd;
|
|
|
|
return constants_1.CompressionMethod.ZstdWithoutLong;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1322,13 +1402,16 @@ function getCacheFileName(compressionMethod) {
|
|
|
|
: constants_1.CacheFilename.Zstd;
|
|
|
|
: constants_1.CacheFilename.Zstd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.getCacheFileName = getCacheFileName;
|
|
|
|
exports.getCacheFileName = getCacheFileName;
|
|
|
|
function isGnuTarInstalled() {
|
|
|
|
function getGnuTarPathOnWindows() {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
if (fs.existsSync(constants_1.GnuTarPathOnWindows)) {
|
|
|
|
|
|
|
|
return constants_1.GnuTarPathOnWindows;
|
|
|
|
|
|
|
|
}
|
|
|
|
const versionOutput = yield getVersion('tar');
|
|
|
|
const versionOutput = yield getVersion('tar');
|
|
|
|
return versionOutput.toLowerCase().includes('gnu tar');
|
|
|
|
return versionOutput.toLowerCase().includes('gnu tar') ? io.which('tar') : '';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.isGnuTarInstalled = isGnuTarInstalled;
|
|
|
|
exports.getGnuTarPathOnWindows = getGnuTarPathOnWindows;
|
|
|
|
function assertDefined(name, value) {
|
|
|
|
function assertDefined(name, value) {
|
|
|
|
if (value === undefined) {
|
|
|
|
if (value === undefined) {
|
|
|
|
throw Error(`Expected ${name} but value was undefiend`);
|
|
|
|
throw Error(`Expected ${name} but value was undefiend`);
|
|
|
@@ -1351,6 +1434,7 @@ exports.isGhes = isGhes;
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.ManifestFilename = exports.TarFilename = exports.SystemTarPathOnWindows = exports.GnuTarPathOnWindows = exports.SocketTimeout = exports.DefaultRetryDelay = exports.DefaultRetryAttempts = exports.ArchiveToolType = exports.CompressionMethod = exports.CacheFilename = void 0;
|
|
|
|
var CacheFilename;
|
|
|
|
var CacheFilename;
|
|
|
|
(function (CacheFilename) {
|
|
|
|
(function (CacheFilename) {
|
|
|
|
CacheFilename["Gzip"] = "cache.tgz";
|
|
|
|
CacheFilename["Gzip"] = "cache.tgz";
|
|
|
@@ -1364,6 +1448,11 @@ var CompressionMethod;
|
|
|
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
|
|
|
CompressionMethod["ZstdWithoutLong"] = "zstd-without-long";
|
|
|
|
CompressionMethod["Zstd"] = "zstd";
|
|
|
|
CompressionMethod["Zstd"] = "zstd";
|
|
|
|
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
|
|
|
})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));
|
|
|
|
|
|
|
|
var ArchiveToolType;
|
|
|
|
|
|
|
|
(function (ArchiveToolType) {
|
|
|
|
|
|
|
|
ArchiveToolType["GNU"] = "gnu";
|
|
|
|
|
|
|
|
ArchiveToolType["BSD"] = "bsd";
|
|
|
|
|
|
|
|
})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));
|
|
|
|
// The default number of retry attempts.
|
|
|
|
// The default number of retry attempts.
|
|
|
|
exports.DefaultRetryAttempts = 2;
|
|
|
|
exports.DefaultRetryAttempts = 2;
|
|
|
|
// The default delay in milliseconds between retry attempts.
|
|
|
|
// The default delay in milliseconds between retry attempts.
|
|
|
@@ -1372,6 +1461,12 @@ exports.DefaultRetryDelay = 5000;
|
|
|
|
// over the socket during this period, the socket is destroyed and the download
|
|
|
|
// over the socket during this period, the socket is destroyed and the download
|
|
|
|
// is aborted.
|
|
|
|
// is aborted.
|
|
|
|
exports.SocketTimeout = 5000;
|
|
|
|
exports.SocketTimeout = 5000;
|
|
|
|
|
|
|
|
// The default path of GNUtar on hosted Windows runners
|
|
|
|
|
|
|
|
exports.GnuTarPathOnWindows = `${process.env['PROGRAMFILES']}\\Git\\usr\\bin\\tar.exe`;
|
|
|
|
|
|
|
|
// The default path of BSDtar on hosted Windows runners
|
|
|
|
|
|
|
|
exports.SystemTarPathOnWindows = `${process.env['SYSTEMDRIVE']}\\Windows\\System32\\tar.exe`;
|
|
|
|
|
|
|
|
exports.TarFilename = 'cache.tar';
|
|
|
|
|
|
|
|
exports.ManifestFilename = 'manifest.txt';
|
|
|
|
//# sourceMappingURL=constants.js.map
|
|
|
|
//# sourceMappingURL=constants.js.map
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ }),
|
|
|
@@ -1381,6 +1476,29 @@ exports.SocketTimeout = 5000;
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -1390,14 +1508,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.downloadCacheStorageSDK = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const storage_blob_1 = __nccwpck_require__(4100);
|
|
|
|
const storage_blob_1 = __nccwpck_require__(4100);
|
|
|
@@ -1532,7 +1644,7 @@ function downloadCacheHttpClient(archiveLocation, archivePath) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const writeStream = fs.createWriteStream(archivePath);
|
|
|
|
const writeStream = fs.createWriteStream(archivePath);
|
|
|
|
const httpClient = new http_client_1.HttpClient('actions/cache');
|
|
|
|
const httpClient = new http_client_1.HttpClient('actions/cache');
|
|
|
|
const downloadResponse = yield requestUtils_1.retryHttpClientResponse('downloadCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); }));
|
|
|
|
const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); }));
|
|
|
|
// Abort download if no traffic received over the socket.
|
|
|
|
// Abort download if no traffic received over the socket.
|
|
|
|
downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => {
|
|
|
|
downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => {
|
|
|
|
downloadResponse.message.destroy();
|
|
|
|
downloadResponse.message.destroy();
|
|
|
@@ -1587,7 +1699,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
|
|
|
|
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
|
|
|
|
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
|
|
|
|
// on 64-bit systems), split the download into multiple segments
|
|
|
|
// on 64-bit systems), split the download into multiple segments
|
|
|
|
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
|
|
|
|
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
|
|
|
|
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
|
|
|
|
// Updated segment size to 128MB = 134217728 bytes, to complete a segment faster and fail fast
|
|
|
|
|
|
|
|
const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH);
|
|
|
|
const downloadProgress = new DownloadProgress(contentLength);
|
|
|
|
const downloadProgress = new DownloadProgress(contentLength);
|
|
|
|
const fd = fs.openSync(archivePath, 'w');
|
|
|
|
const fd = fs.openSync(archivePath, 'w');
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@@ -1639,6 +1752,29 @@ const promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, voi
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -1648,14 +1784,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const http_client_1 = __nccwpck_require__(6255);
|
|
|
|
const constants_1 = __nccwpck_require__(8840);
|
|
|
|
const constants_1 = __nccwpck_require__(8840);
|
|
|
@@ -1766,6 +1896,29 @@ exports.retryHttpClientResponse = retryHttpClientResponse;
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
@@ -1775,14 +1928,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
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 }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.createTar = exports.extractTar = exports.listTar = void 0;
|
|
|
|
const exec_1 = __nccwpck_require__(1514);
|
|
|
|
const exec_1 = __nccwpck_require__(1514);
|
|
|
|
const io = __importStar(__nccwpck_require__(7436));
|
|
|
|
const io = __importStar(__nccwpck_require__(7436));
|
|
|
|
const fs_1 = __nccwpck_require__(7147);
|
|
|
|
const fs_1 = __nccwpck_require__(7147);
|
|
|
@@ -1790,21 +1937,19 @@ const path = __importStar(__nccwpck_require__(1017));
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
|
const utils = __importStar(__nccwpck_require__(1518));
|
|
|
|
const constants_1 = __nccwpck_require__(8840);
|
|
|
|
const constants_1 = __nccwpck_require__(8840);
|
|
|
|
const IS_WINDOWS = process.platform === 'win32';
|
|
|
|
const IS_WINDOWS = process.platform === 'win32';
|
|
|
|
function getTarPath(args, compressionMethod) {
|
|
|
|
// Returns tar path and type: BSD or GNU
|
|
|
|
|
|
|
|
function getTarPath() {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
switch (process.platform) {
|
|
|
|
switch (process.platform) {
|
|
|
|
case 'win32': {
|
|
|
|
case 'win32': {
|
|
|
|
const systemTar = `${process.env['windir']}\\System32\\tar.exe`;
|
|
|
|
const gnuTar = yield utils.getGnuTarPathOnWindows();
|
|
|
|
if (compressionMethod !== constants_1.CompressionMethod.Gzip) {
|
|
|
|
const systemTar = constants_1.SystemTarPathOnWindows;
|
|
|
|
// We only use zstandard compression on windows when gnu tar is installed due to
|
|
|
|
if (gnuTar) {
|
|
|
|
// a bug with compressing large files with bsdtar + zstd
|
|
|
|
// Use GNUtar as default on windows
|
|
|
|
args.push('--force-local');
|
|
|
|
return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (fs_1.existsSync(systemTar)) {
|
|
|
|
else if ((0, fs_1.existsSync)(systemTar)) {
|
|
|
|
return systemTar;
|
|
|
|
return { path: systemTar, type: constants_1.ArchiveToolType.BSD };
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (yield utils.isGnuTarInstalled()) {
|
|
|
|
|
|
|
|
args.push('--force-local');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1812,25 +1957,92 @@ function getTarPath(args, compressionMethod) {
|
|
|
|
const gnuTar = yield io.which('gtar', false);
|
|
|
|
const gnuTar = yield io.which('gtar', false);
|
|
|
|
if (gnuTar) {
|
|
|
|
if (gnuTar) {
|
|
|
|
// fix permission denied errors when extracting BSD tar archive with GNU tar - https://github.com/actions/cache/issues/527
|
|
|
|
// fix permission denied errors when extracting BSD tar archive with GNU tar - https://github.com/actions/cache/issues/527
|
|
|
|
args.push('--delay-directory-restore');
|
|
|
|
return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };
|
|
|
|
return gnuTar;
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
path: yield io.which('tar', true),
|
|
|
|
|
|
|
|
type: constants_1.ArchiveToolType.BSD
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return yield io.which('tar', true);
|
|
|
|
// Default assumption is GNU tar is present in path
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
path: yield io.which('tar', true),
|
|
|
|
|
|
|
|
type: constants_1.ArchiveToolType.GNU
|
|
|
|
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function execTar(args, compressionMethod, cwd) {
|
|
|
|
// Return arguments for tar as per tarPath, compressionMethod, method type and os
|
|
|
|
|
|
|
|
function getTarArgs(tarPath, compressionMethod, type, archivePath = '') {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
try {
|
|
|
|
const args = [`"${tarPath.path}"`];
|
|
|
|
yield exec_1.exec(`"${yield getTarPath(args, compressionMethod)}"`, args, { cwd });
|
|
|
|
const cacheFileName = utils.getCacheFileName(compressionMethod);
|
|
|
|
|
|
|
|
const tarFile = 'cache.tar';
|
|
|
|
|
|
|
|
const workingDirectory = getWorkingDirectory();
|
|
|
|
|
|
|
|
// Speficic args for BSD tar on windows for workaround
|
|
|
|
|
|
|
|
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
|
|
|
|
|
|
|
|
compressionMethod !== constants_1.CompressionMethod.Gzip &&
|
|
|
|
|
|
|
|
IS_WINDOWS;
|
|
|
|
|
|
|
|
// Method specific args
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
|
|
case 'create':
|
|
|
|
|
|
|
|
args.push('--posix', '-cf', BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? tarFile
|
|
|
|
|
|
|
|
: cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), '--exclude', BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? tarFile
|
|
|
|
|
|
|
|
: cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), '--files-from', constants_1.ManifestFilename);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'extract':
|
|
|
|
|
|
|
|
args.push('-xf', BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? tarFile
|
|
|
|
|
|
|
|
: archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/'));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'list':
|
|
|
|
|
|
|
|
args.push('-tf', BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? tarFile
|
|
|
|
|
|
|
|
: archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), '-P');
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
// Platform specific args
|
|
|
|
throw new Error(`Tar failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
|
|
|
|
if (tarPath.type === constants_1.ArchiveToolType.GNU) {
|
|
|
|
|
|
|
|
switch (process.platform) {
|
|
|
|
|
|
|
|
case 'win32':
|
|
|
|
|
|
|
|
args.push('--force-local');
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'darwin':
|
|
|
|
|
|
|
|
args.push('--delay-directory-restore');
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return args;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns commands to run tar and compression program
|
|
|
|
|
|
|
|
function getCommands(compressionMethod, type, archivePath = '') {
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
let args;
|
|
|
|
|
|
|
|
const tarPath = yield getTarPath();
|
|
|
|
|
|
|
|
const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);
|
|
|
|
|
|
|
|
const compressionArgs = type !== 'create'
|
|
|
|
|
|
|
|
? yield getDecompressionProgram(tarPath, compressionMethod, archivePath)
|
|
|
|
|
|
|
|
: yield getCompressionProgram(tarPath, compressionMethod);
|
|
|
|
|
|
|
|
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
|
|
|
|
|
|
|
|
compressionMethod !== constants_1.CompressionMethod.Gzip &&
|
|
|
|
|
|
|
|
IS_WINDOWS;
|
|
|
|
|
|
|
|
if (BSD_TAR_ZSTD && type !== 'create') {
|
|
|
|
|
|
|
|
args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (BSD_TAR_ZSTD) {
|
|
|
|
|
|
|
|
return args;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return [args.join(' ')];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getWorkingDirectory() {
|
|
|
|
function getWorkingDirectory() {
|
|
|
@@ -1838,91 +2050,119 @@ function getWorkingDirectory() {
|
|
|
|
return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();
|
|
|
|
return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Common function for extractTar and listTar to get the compression method
|
|
|
|
// Common function for extractTar and listTar to get the compression method
|
|
|
|
function getCompressionProgram(compressionMethod) {
|
|
|
|
function getDecompressionProgram(tarPath, compressionMethod, archivePath) {
|
|
|
|
// -d: Decompress.
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
// unzstd is equivalent to 'zstd -d'
|
|
|
|
// -d: Decompress.
|
|
|
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
|
|
// unzstd is equivalent to 'zstd -d'
|
|
|
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
|
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
|
|
switch (compressionMethod) {
|
|
|
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
|
|
case constants_1.CompressionMethod.Zstd:
|
|
|
|
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
|
|
|
|
return [
|
|
|
|
compressionMethod !== constants_1.CompressionMethod.Gzip &&
|
|
|
|
'--use-compress-program',
|
|
|
|
IS_WINDOWS;
|
|
|
|
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30'
|
|
|
|
switch (compressionMethod) {
|
|
|
|
];
|
|
|
|
case constants_1.CompressionMethod.Zstd:
|
|
|
|
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
|
|
return BSD_TAR_ZSTD
|
|
|
|
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd'];
|
|
|
|
? [
|
|
|
|
default:
|
|
|
|
'zstd -d --long=30 --force -o',
|
|
|
|
return ['-z'];
|
|
|
|
constants_1.TarFilename,
|
|
|
|
}
|
|
|
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
: [
|
|
|
|
|
|
|
|
'--use-compress-program',
|
|
|
|
|
|
|
|
IS_WINDOWS ? '"zstd -d --long=30"' : 'unzstd --long=30'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
|
|
|
|
|
|
return BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? [
|
|
|
|
|
|
|
|
'zstd -d --force -o',
|
|
|
|
|
|
|
|
constants_1.TarFilename,
|
|
|
|
|
|
|
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
: ['--use-compress-program', IS_WINDOWS ? '"zstd -d"' : 'unzstd'];
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return ['-z'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Used for creating the archive
|
|
|
|
|
|
|
|
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
|
|
|
|
|
|
|
// zstdmt is equivalent to 'zstd -T0'
|
|
|
|
|
|
|
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
|
|
|
|
|
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
|
|
|
|
|
|
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
|
|
|
|
|
|
|
function getCompressionProgram(tarPath, compressionMethod) {
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
const cacheFileName = utils.getCacheFileName(compressionMethod);
|
|
|
|
|
|
|
|
const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&
|
|
|
|
|
|
|
|
compressionMethod !== constants_1.CompressionMethod.Gzip &&
|
|
|
|
|
|
|
|
IS_WINDOWS;
|
|
|
|
|
|
|
|
switch (compressionMethod) {
|
|
|
|
|
|
|
|
case constants_1.CompressionMethod.Zstd:
|
|
|
|
|
|
|
|
return BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? [
|
|
|
|
|
|
|
|
'zstd -T0 --long=30 --force -o',
|
|
|
|
|
|
|
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
constants_1.TarFilename
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
: [
|
|
|
|
|
|
|
|
'--use-compress-program',
|
|
|
|
|
|
|
|
IS_WINDOWS ? '"zstd -T0 --long=30"' : 'zstdmt --long=30'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
|
|
|
|
|
|
return BSD_TAR_ZSTD
|
|
|
|
|
|
|
|
? [
|
|
|
|
|
|
|
|
'zstd -T0 --force -o',
|
|
|
|
|
|
|
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
constants_1.TarFilename
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
: ['--use-compress-program', IS_WINDOWS ? '"zstd -T0"' : 'zstdmt'];
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return ['-z'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Executes all commands as separate processes
|
|
|
|
|
|
|
|
function execCommands(commands, cwd) {
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
for (const command of commands) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
yield (0, exec_1.exec)(command, undefined, {
|
|
|
|
|
|
|
|
cwd,
|
|
|
|
|
|
|
|
env: Object.assign(Object.assign({}, process.env), { MSYS: 'winsymlinks:nativestrict' })
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (error) {
|
|
|
|
|
|
|
|
throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// List the contents of a tar
|
|
|
|
function listTar(archivePath, compressionMethod) {
|
|
|
|
function listTar(archivePath, compressionMethod) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const args = [
|
|
|
|
const commands = yield getCommands(compressionMethod, 'list', archivePath);
|
|
|
|
...getCompressionProgram(compressionMethod),
|
|
|
|
yield execCommands(commands);
|
|
|
|
'-tf',
|
|
|
|
|
|
|
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
'-P'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
yield execTar(args, compressionMethod);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.listTar = listTar;
|
|
|
|
exports.listTar = listTar;
|
|
|
|
|
|
|
|
// Extract a tar
|
|
|
|
function extractTar(archivePath, compressionMethod) {
|
|
|
|
function extractTar(archivePath, compressionMethod) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
// Create directory to extract tar into
|
|
|
|
// Create directory to extract tar into
|
|
|
|
const workingDirectory = getWorkingDirectory();
|
|
|
|
const workingDirectory = getWorkingDirectory();
|
|
|
|
yield io.mkdirP(workingDirectory);
|
|
|
|
yield io.mkdirP(workingDirectory);
|
|
|
|
const args = [
|
|
|
|
const commands = yield getCommands(compressionMethod, 'extract', archivePath);
|
|
|
|
...getCompressionProgram(compressionMethod),
|
|
|
|
yield execCommands(commands);
|
|
|
|
'-xf',
|
|
|
|
|
|
|
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
'-P',
|
|
|
|
|
|
|
|
'-C',
|
|
|
|
|
|
|
|
workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
yield execTar(args, compressionMethod);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.extractTar = extractTar;
|
|
|
|
exports.extractTar = extractTar;
|
|
|
|
|
|
|
|
// Create a tar
|
|
|
|
function createTar(archiveFolder, sourceDirectories, compressionMethod) {
|
|
|
|
function createTar(archiveFolder, sourceDirectories, compressionMethod) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
// Write source directories to manifest.txt to avoid command length limits
|
|
|
|
// Write source directories to manifest.txt to avoid command length limits
|
|
|
|
const manifestFilename = 'manifest.txt';
|
|
|
|
(0, fs_1.writeFileSync)(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\n'));
|
|
|
|
const cacheFileName = utils.getCacheFileName(compressionMethod);
|
|
|
|
const commands = yield getCommands(compressionMethod, 'create');
|
|
|
|
fs_1.writeFileSync(path.join(archiveFolder, manifestFilename), sourceDirectories.join('\n'));
|
|
|
|
yield execCommands(commands, archiveFolder);
|
|
|
|
const workingDirectory = getWorkingDirectory();
|
|
|
|
|
|
|
|
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
|
|
|
|
|
|
|
|
// zstdmt is equivalent to 'zstd -T0'
|
|
|
|
|
|
|
|
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
|
|
|
|
|
|
|
|
// Using 30 here because we also support 32-bit self-hosted runners.
|
|
|
|
|
|
|
|
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
|
|
|
|
|
|
|
|
function getCompressionProgram() {
|
|
|
|
|
|
|
|
switch (compressionMethod) {
|
|
|
|
|
|
|
|
case constants_1.CompressionMethod.Zstd:
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'--use-compress-program',
|
|
|
|
|
|
|
|
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
case constants_1.CompressionMethod.ZstdWithoutLong:
|
|
|
|
|
|
|
|
return ['--use-compress-program', IS_WINDOWS ? 'zstd -T0' : 'zstdmt'];
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return ['-z'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const args = [
|
|
|
|
|
|
|
|
'--posix',
|
|
|
|
|
|
|
|
...getCompressionProgram(),
|
|
|
|
|
|
|
|
'-cf',
|
|
|
|
|
|
|
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
'--exclude',
|
|
|
|
|
|
|
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
'-P',
|
|
|
|
|
|
|
|
'-C',
|
|
|
|
|
|
|
|
workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
|
|
|
|
|
|
|
'--files-from',
|
|
|
|
|
|
|
|
manifestFilename
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
yield execTar(args, compressionMethod, archiveFolder);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.createTar = createTar;
|
|
|
|
exports.createTar = createTar;
|
|
|
@@ -1935,14 +2175,31 @@ exports.createTar = createTar;
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
|
|
|
}) : (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) {
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
var result = {};
|
|
|
|
var result = {};
|
|
|
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
result["default"] = mod;
|
|
|
|
__setModuleDefault(result, mod);
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
|
|
|
exports.getDownloadOptions = exports.getUploadOptions = void 0;
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a copy of the upload options with defaults filled in.
|
|
|
|
* Returns a copy of the upload options with defaults filled in.
|
|
|
@@ -1977,7 +2234,8 @@ function getDownloadOptions(copy) {
|
|
|
|
useAzureSdk: true,
|
|
|
|
useAzureSdk: true,
|
|
|
|
downloadConcurrency: 8,
|
|
|
|
downloadConcurrency: 8,
|
|
|
|
timeoutInMs: 30000,
|
|
|
|
timeoutInMs: 30000,
|
|
|
|
segmentTimeoutInMs: 3600000
|
|
|
|
segmentTimeoutInMs: 600000,
|
|
|
|
|
|
|
|
lookupOnly: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (copy) {
|
|
|
|
if (copy) {
|
|
|
|
if (typeof copy.useAzureSdk === 'boolean') {
|
|
|
|
if (typeof copy.useAzureSdk === 'boolean') {
|
|
|
@@ -1992,6 +2250,9 @@ function getDownloadOptions(copy) {
|
|
|
|
if (typeof copy.segmentTimeoutInMs === 'number') {
|
|
|
|
if (typeof copy.segmentTimeoutInMs === 'number') {
|
|
|
|
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
|
|
|
|
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (typeof copy.lookupOnly === 'boolean') {
|
|
|
|
|
|
|
|
result.lookupOnly = copy.lookupOnly;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
|
|
|
|
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
|
|
|
|
if (segmentDownloadTimeoutMins &&
|
|
|
|
if (segmentDownloadTimeoutMins &&
|
|
|
@@ -2004,6 +2265,7 @@ function getDownloadOptions(copy) {
|
|
|
|
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
|
|
|
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
|
|
|
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
|
|
|
|
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
|
|
|
|
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
|
|
|
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
|
|
|
|
|
|
|
core.debug(`Lookup only: ${result.lookupOnly}`);
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.getDownloadOptions = getDownloadOptions;
|
|
|
|
exports.getDownloadOptions = getDownloadOptions;
|
|
|
@@ -64837,7 +65099,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|
|
|
/***/ ((module) => {
|
|
|
|
/***/ ((module) => {
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
module.exports = JSON.parse('{"ruby":["1.9.3-p551","2.0.0-p648","2.1.9","2.2.10","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.9","2.4.10","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.6.0","2.6.1","2.6.2","2.6.3","2.6.4","2.6.5","2.6.6","2.6.7","2.6.8","2.6.9","2.6.10","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.7.5","2.7.6","2.7.7","2.7.8","3.0.0-preview1","3.0.0-preview2","3.0.0-rc1","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.1.0-preview1","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.2.0-preview1","3.2.0-preview2","3.2.0-preview3","3.2.0-rc1","3.2.0","3.2.1","3.2.2","3.3.0-preview1","head","debug"],"jruby":["9.1.17.0","9.2.9.0","9.2.10.0","9.2.11.0","9.2.11.1","9.2.12.0","9.2.13.0","9.2.14.0","9.2.15.0","9.2.16.0","9.2.17.0","9.2.18.0","9.2.19.0","9.2.20.0","9.2.20.1","9.2.21.0","9.3.0.0","9.3.1.0","9.3.2.0","9.3.3.0","9.3.4.0","9.3.6.0","9.3.7.0","9.3.8.0","9.3.9.0","9.3.10.0","9.4.0.0","9.4.1.0","9.4.2.0","head"],"truffleruby":["19.3.0","19.3.1","20.0.0","20.1.0","20.2.0","20.3.0","21.0.0","21.1.0","21.2.0","21.2.0.1","21.3.0","22.0.0.2","22.1.0","22.2.0","22.3.0","22.3.1","23.0.0-preview1","head"],"truffleruby+graalvm":["21.2.0","21.3.0","22.0.0.2","22.1.0","22.2.0","22.3.0","22.3.1","23.0.0-preview1","head"]}');
|
|
|
|
module.exports = JSON.parse('{"ruby":["1.9.3-p551","2.0.0-p648","2.1.9","2.2.10","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.9","2.4.10","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.6.0","2.6.1","2.6.2","2.6.3","2.6.4","2.6.5","2.6.6","2.6.7","2.6.8","2.6.9","2.6.10","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.7.5","2.7.6","2.7.7","2.7.8","3.0.0-preview1","3.0.0-preview2","3.0.0-rc1","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.1.0-preview1","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.2.0-preview1","3.2.0-preview2","3.2.0-preview3","3.2.0-rc1","3.2.0","3.2.1","3.2.2","3.3.0-preview1","head","debug"],"jruby":["9.1.17.0","9.2.9.0","9.2.10.0","9.2.11.0","9.2.11.1","9.2.12.0","9.2.13.0","9.2.14.0","9.2.15.0","9.2.16.0","9.2.17.0","9.2.18.0","9.2.19.0","9.2.20.0","9.2.20.1","9.2.21.0","9.3.0.0","9.3.1.0","9.3.2.0","9.3.3.0","9.3.4.0","9.3.6.0","9.3.7.0","9.3.8.0","9.3.9.0","9.3.10.0","9.4.0.0","9.4.1.0","9.4.2.0","9.4.3.0","head"],"truffleruby":["19.3.0","19.3.1","20.0.0","20.1.0","20.2.0","20.3.0","21.0.0","21.1.0","21.2.0","21.2.0.1","21.3.0","22.0.0.2","22.1.0","22.2.0","22.3.0","22.3.1","23.0.0-preview1","head"],"truffleruby+graalvm":["21.2.0","21.3.0","22.0.0.2","22.1.0","22.2.0","22.3.0","22.3.1","23.0.0-preview1","head"]}');
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|