pull/1211/head
Aparna Jyothi 2025-01-31 11:46:26 +05:30
parent 91a5e5da06
commit 7188cb1e62
3 changed files with 26 additions and 0 deletions

9
dist/setup/index.js vendored
View File

@ -100184,7 +100184,9 @@ class BaseDistribution {
} }
getNodejsMirrorURLInfo(version) { getNodejsMirrorURLInfo(version) {
const mirrorURL = this.nodeInfo.mirrorURL; const mirrorURL = this.nodeInfo.mirrorURL;
core.info('mirrorURL from getNodejsMirrorURLInfo ' + mirrorURL);
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch); const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
core.info('osArch from translateArchToDistUrl ' + osArch);
version = semver_1.default.clean(version) || ''; version = semver_1.default.clean(version) || '';
const fileName = this.osPlat == 'win32' const fileName = this.osPlat == 'win32'
? `node-v${version}-win-${osArch}` ? `node-v${version}-win-${osArch}`
@ -100195,6 +100197,7 @@ class BaseDistribution {
: `${fileName}.7z` : `${fileName}.7z`
: `${fileName}.tar.gz`; : `${fileName}.tar.gz`;
const url = `${mirrorURL}/v${version}/${urlFileName}`; const url = `${mirrorURL}/v${version}/${urlFileName}`;
core.info('url from construct ' + url);
return { return {
downloadUrl: url, downloadUrl: url,
resolvedVersion: version, resolvedVersion: version,
@ -100528,6 +100531,7 @@ class OfficialBuilds extends base_distribution_1.default {
try { try {
core.info(`Attempting to download using mirror URL...`); core.info(`Attempting to download using mirror URL...`);
downloadPath = yield this.downloadFromMirrorURL(); // Attempt to download from the mirror downloadPath = yield this.downloadFromMirrorURL(); // Attempt to download from the mirror
core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath);
if (downloadPath) { if (downloadPath) {
toolPath = downloadPath; toolPath = downloadPath;
} }
@ -100723,14 +100727,19 @@ class OfficialBuilds extends base_distribution_1.default {
downloadFromMirrorURL() { downloadFromMirrorURL() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const nodeJsVersions = yield this.getMirrorUrVersions(); const nodeJsVersions = yield this.getMirrorUrVersions();
core.info('nodeJsVersions from getMirrorUrVersions ' + nodeJsVersions);
const versions = this.filterVersions(nodeJsVersions); const versions = this.filterVersions(nodeJsVersions);
core.info('versions from filterVersions ' + versions);
const evaluatedVersion = this.evaluateVersions(versions); const evaluatedVersion = this.evaluateVersions(versions);
core.info('evaluatedVersion from evaluatedVersions ' + evaluatedVersion);
if (!evaluatedVersion) { if (!evaluatedVersion) {
throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`); throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
} }
const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion); const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion);
core.info('toolName from getNodejsMirrorURLInfo ' + toolName);
try { try {
const toolPath = yield this.downloadNodejs(toolName); const toolPath = yield this.downloadNodejs(toolName);
core.info('toolPath from downloadNodejs ' + toolPath);
return toolPath; return toolPath;
} }
catch (error) { catch (error) {

View File

@ -139,7 +139,11 @@ export default abstract class BaseDistribution {
protected getNodejsMirrorURLInfo(version: string) { protected getNodejsMirrorURLInfo(version: string) {
const mirrorURL = this.nodeInfo.mirrorURL; const mirrorURL = this.nodeInfo.mirrorURL;
core.info('mirrorURL from getNodejsMirrorURLInfo '+mirrorURL);
const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch); const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch);
core.info('osArch from translateArchToDistUrl '+osArch);
version = semver.clean(version) || ''; version = semver.clean(version) || '';
const fileName: string = const fileName: string =
this.osPlat == 'win32' this.osPlat == 'win32'
@ -153,6 +157,7 @@ export default abstract class BaseDistribution {
: `${fileName}.tar.gz`; : `${fileName}.tar.gz`;
const url = `${mirrorURL}/v${version}/${urlFileName}`; const url = `${mirrorURL}/v${version}/${urlFileName}`;
core.info('url from construct '+url);
return <INodeVersionInfo>{ return <INodeVersionInfo>{
downloadUrl: url, downloadUrl: url,

View File

@ -21,6 +21,7 @@ export default class OfficialBuilds extends BaseDistribution {
try { try {
core.info(`Attempting to download using mirror URL...`); core.info(`Attempting to download using mirror URL...`);
downloadPath = await this.downloadFromMirrorURL(); // Attempt to download from the mirror downloadPath = await this.downloadFromMirrorURL(); // Attempt to download from the mirror
core.info('downloadPath from downloadFromMirrorURL() '+ downloadPath);
if (downloadPath) { if (downloadPath) {
toolPath = downloadPath; toolPath = downloadPath;
} }
@ -317,10 +318,16 @@ export default class OfficialBuilds extends BaseDistribution {
protected async downloadFromMirrorURL() { protected async downloadFromMirrorURL() {
const nodeJsVersions = await this.getMirrorUrVersions(); const nodeJsVersions = await this.getMirrorUrVersions();
core.info('nodeJsVersions from getMirrorUrVersions '+nodeJsVersions);
const versions = this.filterVersions(nodeJsVersions); const versions = this.filterVersions(nodeJsVersions);
core.info('versions from filterVersions '+versions);
const evaluatedVersion = this.evaluateVersions(versions); const evaluatedVersion = this.evaluateVersions(versions);
core.info('evaluatedVersion from evaluatedVersions '+evaluatedVersion);
if (!evaluatedVersion) { if (!evaluatedVersion) {
throw new Error( throw new Error(
`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.` `Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`
@ -329,8 +336,13 @@ export default class OfficialBuilds extends BaseDistribution {
const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion); const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion);
core.info('toolName from getNodejsMirrorURLInfo '+toolName);
try { try {
const toolPath = await this.downloadNodejs(toolName); const toolPath = await this.downloadNodejs(toolName);
core.info('toolPath from downloadNodejs '+toolPath);
return toolPath; return toolPath;
} catch (error) { } catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) { if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {