mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
rebuild dist
This commit is contained in:
parent
dfb8fe134b
commit
8438b85c71
1 changed files with 21 additions and 6 deletions
27
dist/setup/index.js
vendored
27
dist/setup/index.js
vendored
|
@ -70619,6 +70619,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Store manifest data to avoid multiple calls
|
||||
let manifest;
|
||||
let nodeVersions;
|
||||
let osPlat = os.platform();
|
||||
let osArch = translateArchToDistUrl(arch);
|
||||
if (isLtsAlias(versionSpec)) {
|
||||
|
@ -70627,6 +70628,11 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
manifest = yield getManifest(auth);
|
||||
versionSpec = resolveLtsAliasFromManifest(versionSpec, stable, manifest);
|
||||
}
|
||||
if (isLatestSyntax(versionSpec)) {
|
||||
nodeVersions = yield getVersionsFromDist();
|
||||
versionSpec = yield queryDistForMatch(versionSpec, arch, nodeVersions);
|
||||
core.info(`getting latest node version...`);
|
||||
}
|
||||
if (checkLatest) {
|
||||
core.info('Attempt to resolve the latest version from manifest...');
|
||||
const resolvedVersion = yield resolveVersionFromManifest(versionSpec, stable, auth, osArch, manifest);
|
||||
|
@ -70678,7 +70684,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
// Download from nodejs.org
|
||||
//
|
||||
if (!downloadPath) {
|
||||
info = yield getInfoFromDist(versionSpec, arch);
|
||||
info = yield getInfoFromDist(versionSpec, arch, nodeVersions);
|
||||
if (!info) {
|
||||
throw new Error(`Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`);
|
||||
}
|
||||
|
@ -70778,12 +70784,11 @@ function getInfoFromManifest(versionSpec, stable, auth, osArch = translateArchTo
|
|||
return info;
|
||||
});
|
||||
}
|
||||
function getInfoFromDist(versionSpec, arch = os.arch()) {
|
||||
function getInfoFromDist(versionSpec, arch = os.arch(), nodeVersions) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let osPlat = os.platform();
|
||||
let osArch = translateArchToDistUrl(arch);
|
||||
let version;
|
||||
version = yield queryDistForMatch(versionSpec, arch);
|
||||
let version = yield queryDistForMatch(versionSpec, arch, nodeVersions);
|
||||
if (!version) {
|
||||
return null;
|
||||
}
|
||||
|
@ -70842,7 +70847,7 @@ function evaluateVersions(versions, versionSpec) {
|
|||
}
|
||||
return version;
|
||||
}
|
||||
function queryDistForMatch(versionSpec, arch = os.arch()) {
|
||||
function queryDistForMatch(versionSpec, arch = os.arch(), nodeVersions) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let osPlat = os.platform();
|
||||
let osArch = translateArchToDistUrl(arch);
|
||||
|
@ -70861,8 +70866,15 @@ function queryDistForMatch(versionSpec, arch = os.arch()) {
|
|||
default:
|
||||
throw new Error(`Unexpected OS '${osPlat}'`);
|
||||
}
|
||||
if (!nodeVersions) {
|
||||
core.debug('No dist manifest cached');
|
||||
nodeVersions = yield getVersionsFromDist();
|
||||
}
|
||||
let versions = [];
|
||||
let nodeVersions = yield getVersionsFromDist();
|
||||
if (isLatestSyntax(versionSpec)) {
|
||||
core.info(`getting latest node version...`);
|
||||
return nodeVersions[0].version;
|
||||
}
|
||||
nodeVersions.forEach((nodeVersion) => {
|
||||
// ensure this version supports your os and platform
|
||||
if (nodeVersion.files.indexOf(dataFileName) >= 0) {
|
||||
|
@ -70958,6 +70970,9 @@ function parseNodeVersionFile(contents) {
|
|||
return nodeVersion;
|
||||
}
|
||||
exports.parseNodeVersionFile = parseNodeVersionFile;
|
||||
function isLatestSyntax(versionSpec) {
|
||||
return ['current', 'latest', 'node'].includes(versionSpec);
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Reference in a new issue