Compare commits

..

1 Commits

Author SHA1 Message Date
Nikolai Laevskii
7d66b4b309 Add notice about binaries not being updated yet 2023-10-19 11:43:45 +02:00
9 changed files with 5016 additions and 4272 deletions

Binary file not shown.

View File

@ -385,7 +385,7 @@ describe('setup-node', () => {
'Not found in manifest. Falling back to download directly from Node' 'Not found in manifest. Falling back to download directly from Node'
); );
expect(dlSpy).toHaveBeenCalled(); expect(dlSpy).toHaveBeenCalled();
expect(warningSpy).toHaveBeenCalledWith( expect(logSpy).toHaveBeenCalledWith(
`Node version ${versionSpec} for platform ${os.platform} and architecture ${os.arch} was found but failed to download. ` + `Node version ${versionSpec} for platform ${os.platform} and architecture ${os.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' + 'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' +
'To resolve this issue you may either fall back to the older version or try again later.' 'To resolve this issue you may either fall back to the older version or try again later.'

View File

@ -60335,11 +60335,7 @@ 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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -60394,7 +60390,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 (0, cache_utils_1.getPackageManagerInfo)(packageManager); const packageManagerInfo = yield 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;
@ -60427,11 +60423,7 @@ 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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -60473,22 +60465,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: () => (0, exports.getCommandOutputNotEmpty)('npm config get cache', 'Could not get npm cache folder path') getCacheFolderPath: () => 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: () => (0, exports.getCommandOutputNotEmpty)('pnpm store path --silent', 'Could not get pnpm cache folder path') getCacheFolderPath: () => 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 (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir); const yarnVersion = yield 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 (0, exports.getCommandOutput)('yarn cache dir', projectDir) ? yield exports.getCommandOutput('yarn cache dir', projectDir)
: yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir); : yield 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}`);
} }
@ -60508,7 +60500,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 = (0, exports.getCommandOutput)(toolCommand, cwd); const stdOut = exports.getCommandOutput(toolCommand, cwd);
if (!stdOut) { if (!stdOut) {
throw new Error(error); throw new Error(error);
} }
@ -60558,7 +60550,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((0, util_1.unique)()) .filter(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)
@ -60581,7 +60573,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((0, util_1.unique)()); return cacheFoldersPaths.filter(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
@ -60631,7 +60623,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 (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir); const enableGlobalCache = yield 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) {
@ -60715,11 +60707,7 @@ 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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];

405
dist/setup/index.js vendored
View File

@ -65297,203 +65297,158 @@ module.exports = /^#!.*/;
// Note: since nyc uses this module to output coverage, any lines // Note: since nyc uses this module to output coverage, any lines
// that are in the direct sync flow of nyc's outputCoverage are // that are in the direct sync flow of nyc's outputCoverage are
// ignored, since we can never get coverage for them. // ignored, since we can never get coverage for them.
// grab a reference to node's real process object right away var assert = __nccwpck_require__(9491)
var process = global.process var signals = __nccwpck_require__(3710)
const processOk = function (process) { var EE = __nccwpck_require__(2361)
return process && /* istanbul ignore if */
typeof process === 'object' && if (typeof EE !== 'function') {
typeof process.removeListener === 'function' && EE = EE.EventEmitter
typeof process.emit === 'function' &&
typeof process.reallyExit === 'function' &&
typeof process.listeners === 'function' &&
typeof process.kill === 'function' &&
typeof process.pid === 'number' &&
typeof process.on === 'function'
} }
// some kind of non-node environment, just no-op var emitter
/* istanbul ignore if */ if (process.__signal_exit_emitter__) {
if (!processOk(process)) { emitter = process.__signal_exit_emitter__
module.exports = function () {
return function () {}
}
} else { } else {
var assert = __nccwpck_require__(9491) emitter = process.__signal_exit_emitter__ = new EE()
var signals = __nccwpck_require__(3710) emitter.count = 0
var isWin = /^win/i.test(process.platform) emitter.emitted = {}
}
var EE = __nccwpck_require__(2361) // Because this emitter is a global, we have to check to see if a
/* istanbul ignore if */ // previous version of this library failed to enable infinite listeners.
if (typeof EE !== 'function') { // I know what you're about to say. But literally everything about
EE = EE.EventEmitter // signal-exit is a compromise with evil. Get used to it.
if (!emitter.infinite) {
emitter.setMaxListeners(Infinity)
emitter.infinite = true
}
module.exports = function (cb, opts) {
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
if (loaded === false) {
load()
} }
var emitter var ev = 'exit'
if (process.__signal_exit_emitter__) { if (opts && opts.alwaysLast) {
emitter = process.__signal_exit_emitter__ ev = 'afterexit'
} else {
emitter = process.__signal_exit_emitter__ = new EE()
emitter.count = 0
emitter.emitted = {}
} }
// Because this emitter is a global, we have to check to see if a var remove = function () {
// previous version of this library failed to enable infinite listeners. emitter.removeListener(ev, cb)
// I know what you're about to say. But literally everything about if (emitter.listeners('exit').length === 0 &&
// signal-exit is a compromise with evil. Get used to it. emitter.listeners('afterexit').length === 0) {
if (!emitter.infinite) { unload()
emitter.setMaxListeners(Infinity) }
emitter.infinite = true
} }
emitter.on(ev, cb)
module.exports = function (cb, opts) { return remove
/* istanbul ignore if */ }
if (!processOk(global.process)) {
return function () {}
}
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
if (loaded === false) { module.exports.unload = unload
load() function unload () {
} if (!loaded) {
return
var ev = 'exit'
if (opts && opts.alwaysLast) {
ev = 'afterexit'
}
var remove = function () {
emitter.removeListener(ev, cb)
if (emitter.listeners('exit').length === 0 &&
emitter.listeners('afterexit').length === 0) {
unload()
}
}
emitter.on(ev, cb)
return remove
} }
loaded = false
var unload = function unload () {
if (!loaded || !processOk(global.process)) {
return
}
loaded = false
signals.forEach(function (sig) {
try {
process.removeListener(sig, sigListeners[sig])
} catch (er) {}
})
process.emit = originalProcessEmit
process.reallyExit = originalProcessReallyExit
emitter.count -= 1
}
module.exports.unload = unload
var emit = function emit (event, code, signal) {
/* istanbul ignore if */
if (emitter.emitted[event]) {
return
}
emitter.emitted[event] = true
emitter.emit(event, code, signal)
}
// { <signal>: <listener fn>, ... }
var sigListeners = {}
signals.forEach(function (sig) { signals.forEach(function (sig) {
sigListeners[sig] = function listener () { try {
/* istanbul ignore if */ process.removeListener(sig, sigListeners[sig])
if (!processOk(global.process)) { } catch (er) {}
return })
} process.emit = originalProcessEmit
// If there are no other listeners, an exit is coming! process.reallyExit = originalProcessReallyExit
// Simplest way: remove us and then re-send the signal. emitter.count -= 1
// We know that this will kill the process, so we can }
// safely emit now.
var listeners = process.listeners(sig) function emit (event, code, signal) {
if (listeners.length === emitter.count) { if (emitter.emitted[event]) {
unload() return
emit('exit', null, sig) }
/* istanbul ignore next */ emitter.emitted[event] = true
emit('afterexit', null, sig) emitter.emit(event, code, signal)
/* istanbul ignore next */ }
if (isWin && sig === 'SIGHUP') {
// "SIGHUP" throws an `ENOSYS` error on Windows, // { <signal>: <listener fn>, ... }
// so use a supported signal instead var sigListeners = {}
sig = 'SIGINT' signals.forEach(function (sig) {
} sigListeners[sig] = function listener () {
/* istanbul ignore next */ // If there are no other listeners, an exit is coming!
process.kill(process.pid, sig) // Simplest way: remove us and then re-send the signal.
} // We know that this will kill the process, so we can
// safely emit now.
var listeners = process.listeners(sig)
if (listeners.length === emitter.count) {
unload()
emit('exit', null, sig)
/* istanbul ignore next */
emit('afterexit', null, sig)
/* istanbul ignore next */
process.kill(process.pid, sig)
}
}
})
module.exports.signals = function () {
return signals
}
module.exports.load = load
var loaded = false
function load () {
if (loaded) {
return
}
loaded = true
// This is the number of onSignalExit's that are in play.
// It's important so that we can count the correct number of
// listeners on signals, and don't wait for the other one to
// handle it instead of us.
emitter.count += 1
signals = signals.filter(function (sig) {
try {
process.on(sig, sigListeners[sig])
return true
} catch (er) {
return false
} }
}) })
module.exports.signals = function () { process.emit = processEmit
return signals process.reallyExit = processReallyExit
} }
var loaded = false var originalProcessReallyExit = process.reallyExit
function processReallyExit (code) {
process.exitCode = code || 0
emit('exit', process.exitCode, null)
/* istanbul ignore next */
emit('afterexit', process.exitCode, null)
/* istanbul ignore next */
originalProcessReallyExit.call(process, process.exitCode)
}
var load = function load () { var originalProcessEmit = process.emit
if (loaded || !processOk(global.process)) { function processEmit (ev, arg) {
return if (ev === 'exit') {
if (arg !== undefined) {
process.exitCode = arg
} }
loaded = true var ret = originalProcessEmit.apply(this, arguments)
// This is the number of onSignalExit's that are in play.
// It's important so that we can count the correct number of
// listeners on signals, and don't wait for the other one to
// handle it instead of us.
emitter.count += 1
signals = signals.filter(function (sig) {
try {
process.on(sig, sigListeners[sig])
return true
} catch (er) {
return false
}
})
process.emit = processEmit
process.reallyExit = processReallyExit
}
module.exports.load = load
var originalProcessReallyExit = process.reallyExit
var processReallyExit = function processReallyExit (code) {
/* istanbul ignore if */
if (!processOk(global.process)) {
return
}
process.exitCode = code || /* istanbul ignore next */ 0
emit('exit', process.exitCode, null) emit('exit', process.exitCode, null)
/* istanbul ignore next */ /* istanbul ignore next */
emit('afterexit', process.exitCode, null) emit('afterexit', process.exitCode, null)
/* istanbul ignore next */ return ret
originalProcessReallyExit.call(process, process.exitCode) } else {
} return originalProcessEmit.apply(this, arguments)
var originalProcessEmit = process.emit
var processEmit = function processEmit (ev, arg) {
if (ev === 'exit' && processOk(global.process)) {
/* istanbul ignore else */
if (arg !== undefined) {
process.exitCode = arg
}
var ret = originalProcessEmit.apply(this, arguments)
/* istanbul ignore next */
emit('exit', process.exitCode, null)
/* istanbul ignore next */
emit('afterexit', process.exitCode, null)
/* istanbul ignore next */
return ret
} else {
return originalProcessEmit.apply(this, arguments)
}
} }
} }
@ -71814,11 +71769,7 @@ function wrappy (fn, cb) {
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -71893,11 +71844,7 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -71936,12 +71883,12 @@ const fs_1 = __importDefault(__nccwpck_require__(7147));
const constants_1 = __nccwpck_require__(9042); const constants_1 = __nccwpck_require__(9042);
const cache_utils_1 = __nccwpck_require__(1678); const cache_utils_1 = __nccwpck_require__(1678);
const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager); const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
if (!packageManagerInfo) { if (!packageManagerInfo) {
throw new Error(`Caching for '${packageManager}' is not supported`); throw new Error(`Caching for '${packageManager}' is not supported`);
} }
const platform = process.env.RUNNER_OS; const platform = process.env.RUNNER_OS;
const cachePaths = yield (0, cache_utils_1.getCacheDirectories)(packageManagerInfo, cacheDependencyPath); const cachePaths = yield cache_utils_1.getCacheDirectories(packageManagerInfo, cacheDependencyPath);
core.saveState(constants_1.State.CachePaths, cachePaths); core.saveState(constants_1.State.CachePaths, cachePaths);
const lockFilePath = cacheDependencyPath const lockFilePath = cacheDependencyPath
? cacheDependencyPath ? cacheDependencyPath
@ -71954,7 +71901,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
const primaryKey = `${keyPrefix}-${fileHash}`; const primaryKey = `${keyPrefix}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`); core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey); core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const isManagedByYarnBerry = yield (0, cache_utils_1.repoHasYarnBerryManagedDependencies)(packageManagerInfo, cacheDependencyPath); const isManagedByYarnBerry = yield cache_utils_1.repoHasYarnBerryManagedDependencies(packageManagerInfo, cacheDependencyPath);
let cacheKey; let cacheKey;
if (isManagedByYarnBerry) { if (isManagedByYarnBerry) {
core.info('All dependencies are managed locally by yarn3, the previous cache can be used'); core.info('All dependencies are managed locally by yarn3, the previous cache can be used');
@ -71993,11 +71940,7 @@ const findLockFile = (packageManager) => {
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -72039,22 +71982,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: () => (0, exports.getCommandOutputNotEmpty)('npm config get cache', 'Could not get npm cache folder path') getCacheFolderPath: () => 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: () => (0, exports.getCommandOutputNotEmpty)('pnpm store path --silent', 'Could not get pnpm cache folder path') getCacheFolderPath: () => 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 (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir); const yarnVersion = yield 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 (0, exports.getCommandOutput)('yarn cache dir', projectDir) ? yield exports.getCommandOutput('yarn cache dir', projectDir)
: yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir); : yield 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}`);
} }
@ -72074,7 +72017,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 = (0, exports.getCommandOutput)(toolCommand, cwd); const stdOut = exports.getCommandOutput(toolCommand, cwd);
if (!stdOut) { if (!stdOut) {
throw new Error(error); throw new Error(error);
} }
@ -72124,7 +72067,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((0, util_1.unique)()) .filter(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)
@ -72147,7 +72090,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((0, util_1.unique)()); return cacheFoldersPaths.filter(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
@ -72197,7 +72140,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 (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir); const enableGlobalCache = yield 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) {
@ -72281,11 +72224,7 @@ 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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -72360,11 +72299,7 @@ exports["default"] = BasePrereleaseNodejs;
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -72526,7 +72461,7 @@ class BaseDistribution {
const initialUrl = this.getDistributionUrl(); const initialUrl = this.getDistributionUrl();
const osArch = this.translateArchToDistUrl(arch); const osArch = this.translateArchToDistUrl(arch);
// Create temporary folder to download to // Create temporary folder to download to
const tempDownloadFolder = `temp_${(0, uuid_1.v4)()}`; const tempDownloadFolder = `temp_${uuid_1.v4()}`;
const tempDirectory = process.env['RUNNER_TEMP'] || ''; const tempDirectory = process.env['RUNNER_TEMP'] || '';
assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined'); assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
const tempDir = path.join(tempDirectory, tempDownloadFolder); const tempDir = path.join(tempDirectory, tempDownloadFolder);
@ -72709,11 +72644,7 @@ exports["default"] = NightlyNodejs;
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -72752,7 +72683,6 @@ class OfficialBuilds extends base_distribution_1.default {
super(nodeInfo); super(nodeInfo);
} }
setupNodeJs() { setupNodeJs() {
var _a;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let manifest; let manifest;
let nodeJsVersions; let nodeJsVersions;
@ -72783,12 +72713,15 @@ class OfficialBuilds extends base_distribution_1.default {
let toolPath = this.findVersionInHostedToolCacheDirectory(); let toolPath = this.findVersionInHostedToolCacheDirectory();
if (toolPath) { if (toolPath) {
core.info(`Found in cache @ ${toolPath}`); core.info(`Found in cache @ ${toolPath}`);
this.addToolPath(toolPath); if (this.osPlat != 'win32') {
toolPath = path_1.default.join(toolPath, 'bin');
}
core.addPath(toolPath);
return; return;
} }
let downloadPath = ''; let downloadPath = '';
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
try { try {
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
const versionInfo = yield this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest); const versionInfo = yield this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
if (versionInfo) { if (versionInfo) {
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`); core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
@ -72810,7 +72743,7 @@ class OfficialBuilds extends base_distribution_1.default {
else { else {
core.info(err.message); core.info(err.message);
} }
core.debug((_a = err.stack) !== null && _a !== void 0 ? _a : 'empty stack'); core.debug(err.stack);
core.info('Falling back to download directly from Node'); core.info('Falling back to download directly from Node');
} }
if (!toolPath) { if (!toolPath) {
@ -72822,12 +72755,6 @@ class OfficialBuilds extends base_distribution_1.default {
core.addPath(toolPath); core.addPath(toolPath);
}); });
} }
addToolPath(toolPath) {
if (this.osPlat != 'win32') {
toolPath = path_1.default.join(toolPath, 'bin');
}
core.addPath(toolPath);
}
downloadDirectlyFromNode() { downloadDirectlyFromNode() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const nodeJsVersions = yield this.getNodeJsVersions(); const nodeJsVersions = yield this.getNodeJsVersions();
@ -72843,7 +72770,7 @@ class OfficialBuilds extends base_distribution_1.default {
} }
catch (error) { catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) { if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
core.warning(`Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` + core.info(`Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' + 'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' +
'To resolve this issue you may either fall back to the older version or try again later.'); 'To resolve this issue you may either fall back to the older version or try again later.');
} }
@ -72988,11 +72915,7 @@ exports["default"] = CanaryBuild;
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -73063,19 +72986,19 @@ function run() {
stable, stable,
arch arch
}; };
const nodeDistribution = (0, installer_factory_1.getNodejsDistribution)(nodejsInfo); const nodeDistribution = installer_factory_1.getNodejsDistribution(nodejsInfo);
yield nodeDistribution.setupNodeJs(); yield nodeDistribution.setupNodeJs();
} }
yield (0, util_1.printEnvDetailsAndSetOutput)(); yield util_1.printEnvDetailsAndSetOutput();
const registryUrl = core.getInput('registry-url'); const registryUrl = core.getInput('registry-url');
const alwaysAuth = core.getInput('always-auth'); const alwaysAuth = core.getInput('always-auth');
if (registryUrl) { if (registryUrl) {
auth.configAuthentication(registryUrl, alwaysAuth); auth.configAuthentication(registryUrl, alwaysAuth);
} }
if (cache && (0, cache_utils_1.isCacheFeatureAvailable)()) { if (cache && cache_utils_1.isCacheFeatureAvailable()) {
core.saveState(constants_1.State.CachePackageManager, cache); core.saveState(constants_1.State.CachePackageManager, cache);
const cacheDependencyPath = core.getInput('cache-dependency-path'); const cacheDependencyPath = core.getInput('cache-dependency-path');
yield (0, cache_restore_1.restoreCache)(cache, cacheDependencyPath); yield cache_restore_1.restoreCache(cache, cacheDependencyPath);
} }
const matchersPath = path.join(__dirname, '../..', '.github'); const matchersPath = path.join(__dirname, '../..', '.github');
core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`); core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
@ -73102,7 +73025,7 @@ function resolveVersionInput() {
if (!fs_1.default.existsSync(versionFilePath)) { if (!fs_1.default.existsSync(versionFilePath)) {
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`); throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
} }
version = (0, util_1.parseNodeVersionFile)(fs_1.default.readFileSync(versionFilePath, 'utf8')); version = util_1.parseNodeVersionFile(fs_1.default.readFileSync(versionFilePath, 'utf8'));
core.info(`Resolved ${versionFileInput} as ${version}`); core.info(`Resolved ${versionFileInput} as ${version}`);
} }
return version; return version;
@ -73118,11 +73041,7 @@ function resolveVersionInput() {
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;
var desc = Object.getOwnPropertyDescriptor(m, k); Object.defineProperty(o, k2, { enumerable: true, get: function() { return 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];
@ -73471,7 +73390,7 @@ var exports = __webpack_exports__;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const main_1 = __nccwpck_require__(399); const main_1 = __nccwpck_require__(399);
(0, main_1.run)(); main_1.run();
})(); })();

5428
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,22 +37,22 @@
"uuid": "^9.0.0" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.6", "@types/jest": "^27.0.2",
"@types/node": "^16.11.25", "@types/node": "^16.11.25",
"@types/semver": "^6.0.0", "@types/semver": "^6.0.0",
"@types/uuid": "^9.0.3", "@types/uuid": "^9.0.3",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.33.4",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1", "eslint-plugin-jest": "^27.2.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"jest": "^29.7.0", "jest": "^27.2.5",
"jest-circus": "^29.7.0", "jest-circus": "^27.2.5",
"jest-each": "^29.7.0", "jest-each": "^27.2.5",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"ts-jest": "^29.1.1", "ts-jest": "^27.0.5",
"typescript": "^4.2.3" "typescript": "^4.2.3"
} }
} }

View File

@ -17,7 +17,7 @@ export async function run() {
const cacheLock = core.getState(State.CachePackageManager); const cacheLock = core.getState(State.CachePackageManager);
await cachePackages(cacheLock); await cachePackages(cacheLock);
} catch (error) { } catch (error) {
core.setFailed((error as Error).message); core.setFailed(error.message);
} }
} }

View File

@ -18,7 +18,6 @@ export default class OfficialBuilds extends BaseDistribution {
let manifest: tc.IToolRelease[] | undefined; let manifest: tc.IToolRelease[] | undefined;
let nodeJsVersions: INodeVersion[] | undefined; let nodeJsVersions: INodeVersion[] | undefined;
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch); const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
if (this.isLtsAlias(this.nodeInfo.versionSpec)) { if (this.isLtsAlias(this.nodeInfo.versionSpec)) {
core.info('Attempt to resolve LTS alias from manifest...'); core.info('Attempt to resolve LTS alias from manifest...');
@ -62,14 +61,19 @@ export default class OfficialBuilds extends BaseDistribution {
if (toolPath) { if (toolPath) {
core.info(`Found in cache @ ${toolPath}`); core.info(`Found in cache @ ${toolPath}`);
this.addToolPath(toolPath);
if (this.osPlat != 'win32') {
toolPath = path.join(toolPath, 'bin');
}
core.addPath(toolPath);
return; return;
} }
let downloadPath = ''; let downloadPath = '';
try { core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
try {
const versionInfo = await this.getInfoFromManifest( const versionInfo = await this.getInfoFromManifest(
this.nodeInfo.versionSpec, this.nodeInfo.versionSpec,
this.nodeInfo.stable, this.nodeInfo.stable,
@ -81,6 +85,7 @@ export default class OfficialBuilds extends BaseDistribution {
core.info( core.info(
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}` `Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`
); );
downloadPath = await tc.downloadTool( downloadPath = await tc.downloadTool(
versionInfo.downloadUrl, versionInfo.downloadUrl,
undefined, undefined,
@ -105,9 +110,9 @@ export default class OfficialBuilds extends BaseDistribution {
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded` `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
); );
} else { } else {
core.info((err as Error).message); core.info(err.message);
} }
core.debug((err as Error).stack ?? 'empty stack'); core.debug(err.stack);
core.info('Falling back to download directly from Node'); core.info('Falling back to download directly from Node');
} }
@ -122,14 +127,6 @@ export default class OfficialBuilds extends BaseDistribution {
core.addPath(toolPath); core.addPath(toolPath);
} }
protected addToolPath(toolPath: string) {
if (this.osPlat != 'win32') {
toolPath = path.join(toolPath, 'bin');
}
core.addPath(toolPath);
}
protected async downloadDirectlyFromNode() { protected async downloadDirectlyFromNode() {
const nodeJsVersions = await this.getNodeJsVersions(); const nodeJsVersions = await this.getNodeJsVersions();
const versions = this.filterVersions(nodeJsVersions); const versions = this.filterVersions(nodeJsVersions);
@ -148,7 +145,7 @@ export default class OfficialBuilds extends BaseDistribution {
return toolPath; return toolPath;
} catch (error) { } catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) { if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
core.warning( core.info(
`Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` + `Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' + 'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' +
'To resolve this issue you may either fall back to the older version or try again later.' 'To resolve this issue you may either fall back to the older version or try again later.'
@ -246,7 +243,7 @@ export default class OfficialBuilds extends BaseDistribution {
return info?.resolvedVersion; return info?.resolvedVersion;
} catch (err) { } catch (err) {
core.info('Unable to resolve version from manifest...'); core.info('Unable to resolve version from manifest...');
core.debug((err as Error).message); core.debug(err.message);
} }
} }

View File

@ -75,7 +75,7 @@ export async function run() {
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}` `##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
); );
} catch (err) { } catch (err) {
core.setFailed((err as Error).message); core.setFailed(err.message);
} }
} }