|
|
|
@ -60335,7 +60335,11 @@ exports.debug = debug; // for test
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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) {
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
o[k2] = m[k];
|
|
|
|
o[k2] = m[k];
|
|
|
|
@ -60390,7 +60394,7 @@ const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, func
|
|
|
|
const state = core.getState(constants_1.State.CacheMatchedKey);
|
|
|
|
const state = core.getState(constants_1.State.CacheMatchedKey);
|
|
|
|
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
|
|
|
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
|
|
|
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
|
|
|
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
|
|
|
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
|
|
|
|
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
|
|
|
if (!packageManagerInfo) {
|
|
|
|
if (!packageManagerInfo) {
|
|
|
|
core.debug(`Caching for '${packageManager}' is not supported`);
|
|
|
|
core.debug(`Caching for '${packageManager}' is not supported`);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -60423,7 +60427,11 @@ run();
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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) {
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
o[k2] = m[k];
|
|
|
|
o[k2] = m[k];
|
|
|
|
@ -60465,22 +60473,22 @@ exports.supportedPackageManagers = {
|
|
|
|
npm: {
|
|
|
|
npm: {
|
|
|
|
name: 'npm',
|
|
|
|
name: 'npm',
|
|
|
|
lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],
|
|
|
|
lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],
|
|
|
|
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('npm config get cache', 'Could not get npm cache folder path')
|
|
|
|
getCacheFolderPath: () => (0, exports.getCommandOutputNotEmpty)('npm config get cache', 'Could not get npm cache folder path')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pnpm: {
|
|
|
|
pnpm: {
|
|
|
|
name: 'pnpm',
|
|
|
|
name: 'pnpm',
|
|
|
|
lockFilePatterns: ['pnpm-lock.yaml'],
|
|
|
|
lockFilePatterns: ['pnpm-lock.yaml'],
|
|
|
|
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('pnpm store path --silent', 'Could not get pnpm cache folder path')
|
|
|
|
getCacheFolderPath: () => (0, exports.getCommandOutputNotEmpty)('pnpm store path --silent', 'Could not get pnpm cache folder path')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yarn: {
|
|
|
|
yarn: {
|
|
|
|
name: 'yarn',
|
|
|
|
name: 'yarn',
|
|
|
|
lockFilePatterns: ['yarn.lock'],
|
|
|
|
lockFilePatterns: ['yarn.lock'],
|
|
|
|
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
const yarnVersion = yield exports.getCommandOutputNotEmpty(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
|
|
|
const yarnVersion = yield (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
|
|
|
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
|
|
|
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
|
|
|
const stdOut = yarnVersion.startsWith('1.')
|
|
|
|
const stdOut = yarnVersion.startsWith('1.')
|
|
|
|
? yield exports.getCommandOutput('yarn cache dir', projectDir)
|
|
|
|
? yield (0, exports.getCommandOutput)('yarn cache dir', projectDir)
|
|
|
|
: yield exports.getCommandOutput('yarn config get cacheFolder', projectDir);
|
|
|
|
: yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
|
|
|
|
if (!stdOut) {
|
|
|
|
if (!stdOut) {
|
|
|
|
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
|
|
|
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -60500,7 +60508,7 @@ const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
exports.getCommandOutput = getCommandOutput;
|
|
|
|
exports.getCommandOutput = getCommandOutput;
|
|
|
|
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
const stdOut = exports.getCommandOutput(toolCommand, cwd);
|
|
|
|
const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
|
|
|
|
if (!stdOut) {
|
|
|
|
if (!stdOut) {
|
|
|
|
throw new Error(error);
|
|
|
|
throw new Error(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -60550,7 +60558,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|
|
|
const cacheDependenciesPaths = yield globber.glob();
|
|
|
|
const cacheDependenciesPaths = yield globber.glob();
|
|
|
|
const existingDirectories = cacheDependenciesPaths
|
|
|
|
const existingDirectories = cacheDependenciesPaths
|
|
|
|
.map(path_1.default.dirname)
|
|
|
|
.map(path_1.default.dirname)
|
|
|
|
.filter(util_1.unique())
|
|
|
|
.filter((0, util_1.unique)())
|
|
|
|
.map(dirName => fs_1.default.realpathSync(dirName))
|
|
|
|
.map(dirName => fs_1.default.realpathSync(dirName))
|
|
|
|
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
|
|
|
|
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
|
|
|
|
if (!existingDirectories.length)
|
|
|
|
if (!existingDirectories.length)
|
|
|
|
@ -60573,7 +60581,7 @@ const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDep
|
|
|
|
return cacheFolderPath;
|
|
|
|
return cacheFolderPath;
|
|
|
|
})));
|
|
|
|
})));
|
|
|
|
// uniq in order to do not cache the same directories twice
|
|
|
|
// uniq in order to do not cache the same directories twice
|
|
|
|
return cacheFoldersPaths.filter(util_1.unique());
|
|
|
|
return cacheFoldersPaths.filter((0, util_1.unique)());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
|
|
|
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
|
|
|
@ -60623,7 +60631,7 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|
|
|
return Promise.resolve(false);
|
|
|
|
return Promise.resolve(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// NOTE: yarn1 returns 'undefined' with return code = 0
|
|
|
|
// NOTE: yarn1 returns 'undefined' with return code = 0
|
|
|
|
const enableGlobalCache = yield exports.getCommandOutput('yarn config get enableGlobalCache', workDir);
|
|
|
|
const enableGlobalCache = yield (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
|
|
|
|
// only local cache is not managed by yarn
|
|
|
|
// only local cache is not managed by yarn
|
|
|
|
const managed = enableGlobalCache.includes('false');
|
|
|
|
const managed = enableGlobalCache.includes('false');
|
|
|
|
if (managed) {
|
|
|
|
if (managed) {
|
|
|
|
@ -60707,7 +60715,11 @@ var Outputs;
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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) {
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
o[k2] = m[k];
|
|
|
|
o[k2] = m[k];
|
|
|
|
|