From a965b3d47937dcf1a5fa6178d737715347884479 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 5 Dec 2022 20:18:53 +0100 Subject: [PATCH 1/4] minor fix --- dist/setup/index.js | 15 ++++++++------- src/installer.ts | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 04c53eeeb..54b2908b7 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63231,9 +63231,13 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { return __awaiter(this, void 0, void 0, function* () { let manifest; let osPlat = os_1.default.platform(); + if (versionSpec === utils_1.StableReleaseAlias.Stable || + versionSpec === utils_1.StableReleaseAlias.OldStable) { + manifest = yield getManifest(auth); + versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest); + } if (checkLatest) { core.info('Attempting to resolve the latest version from the manifest...'); - manifest = yield getManifest(auth); const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest); if (resolvedVersion) { versionSpec = resolvedVersion; @@ -63243,11 +63247,6 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { core.info(`Failed to resolve version ${versionSpec} from manifest`); } } - if (versionSpec === utils_1.StableReleaseAlias.Stable || - versionSpec === utils_1.StableReleaseAlias.OldStable) { - manifest !== null && manifest !== void 0 ? manifest : (manifest = yield getManifest(auth)); - versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest); - } // check cache let toolPath; toolPath = tc.find('go', versionSpec, arch); @@ -63263,7 +63262,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { // Try download from internal distribution (popular versions only) // try { - info = yield getInfoFromManifest(versionSpec, true, auth, arch); + info = yield getInfoFromManifest(versionSpec, true, auth, arch, manifest); if (info) { downloadPath = yield installGoVersion(info, auth, arch); } @@ -63309,6 +63308,7 @@ function resolveVersionFromManifest(versionSpec, stable, auth, arch, manifest) { return info === null || info === void 0 ? void 0 : info.resolvedVersion; } catch (err) { + console.log('didnt fail'); core.info('Unable to resolve a version from the manifest...'); core.debug(err.message); } @@ -63361,6 +63361,7 @@ function getInfoFromManifest(versionSpec, stable, auth, arch = os_1.default.arch core.debug('No manifest cached'); manifest = yield getManifest(auth); } + console.log('didnt fail898998'); core.info(`matching ${versionSpec}...`); const rel = yield tc.findFromManifest(versionSpec, stable, manifest, arch); if (rel && rel.files.length > 0) { diff --git a/src/installer.ts b/src/installer.ts index 84c9242f1..440273d84 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -39,9 +39,21 @@ export async function getGo( let manifest: tc.IToolRelease[] | undefined; let osPlat: string = os.platform(); + if ( + versionSpec === StableReleaseAlias.Stable || + versionSpec === StableReleaseAlias.OldStable + ) { + manifest = await getManifest(auth); + versionSpec = await resolveStableVersionInput( + versionSpec, + auth, + arch, + manifest + ); + } + if (checkLatest) { core.info('Attempting to resolve the latest version from the manifest...'); - manifest = await getManifest(auth); const resolvedVersion = await resolveVersionFromManifest( versionSpec, true, @@ -57,19 +69,6 @@ export async function getGo( } } - if ( - versionSpec === StableReleaseAlias.Stable || - versionSpec === StableReleaseAlias.OldStable - ) { - manifest ??= await getManifest(auth); - versionSpec = await resolveStableVersionInput( - versionSpec, - auth, - arch, - manifest - ); - } - // check cache let toolPath: string; toolPath = tc.find('go', versionSpec, arch); @@ -86,7 +85,7 @@ export async function getGo( // Try download from internal distribution (popular versions only) // try { - info = await getInfoFromManifest(versionSpec, true, auth, arch); + info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest); if (info) { downloadPath = await installGoVersion(info, auth, arch); } else { @@ -148,6 +147,7 @@ async function resolveVersionFromManifest( ); return info?.resolvedVersion; } catch (err) { + console.log('didnt fail'); core.info('Unable to resolve a version from the manifest...'); core.debug(err.message); } @@ -214,7 +214,7 @@ export async function getInfoFromManifest( core.debug('No manifest cached'); manifest = await getManifest(auth); } - + console.log('didnt fail898998'); core.info(`matching ${versionSpec}...`); const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch); From 6cc33f66c0a46d93b6e722bd0a45d2e51462db58 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 5 Dec 2022 20:51:30 +0100 Subject: [PATCH 2/4] change prettier version --- package-lock.json | 19 ++++++++----------- package.json | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5d4490ca3..24d1487cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "jest": "^27.2.5", "jest-circus": "^27.2.5", "nock": "^10.0.6", - "prettier": "^2.8.0", + "prettier": "^1.17.1", "ts-jest": "^27.0.5", "typescript": "^4.3.3" } @@ -4062,18 +4062,15 @@ } }, "node_modules/prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "node": ">=4" } }, "node_modules/pretty-format": { @@ -8121,9 +8118,9 @@ "dev": true }, "prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true }, "pretty-format": { diff --git a/package.json b/package.json index 9a1aa88e8..a12677c09 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "jest": "^27.2.5", "jest-circus": "^27.2.5", "nock": "^10.0.6", - "prettier": "^2.8.0", + "prettier": "^1.17.1", "ts-jest": "^27.0.5", "typescript": "^4.3.3" } From 487336cf4aa836d9ee22df4a4064490f5c0f34e6 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 5 Dec 2022 22:52:48 +0100 Subject: [PATCH 3/4] remove logs and rebuild --- dist/setup/index.js | 2 -- src/installer.ts | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 54b2908b7..b7bc811be 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63308,7 +63308,6 @@ function resolveVersionFromManifest(versionSpec, stable, auth, arch, manifest) { return info === null || info === void 0 ? void 0 : info.resolvedVersion; } catch (err) { - console.log('didnt fail'); core.info('Unable to resolve a version from the manifest...'); core.debug(err.message); } @@ -63361,7 +63360,6 @@ function getInfoFromManifest(versionSpec, stable, auth, arch = os_1.default.arch core.debug('No manifest cached'); manifest = yield getManifest(auth); } - console.log('didnt fail898998'); core.info(`matching ${versionSpec}...`); const rel = yield tc.findFromManifest(versionSpec, stable, manifest, arch); if (rel && rel.files.length > 0) { diff --git a/src/installer.ts b/src/installer.ts index 440273d84..0062e76fb 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -147,7 +147,6 @@ async function resolveVersionFromManifest( ); return info?.resolvedVersion; } catch (err) { - console.log('didnt fail'); core.info('Unable to resolve a version from the manifest...'); core.debug(err.message); } @@ -214,7 +213,7 @@ export async function getInfoFromManifest( core.debug('No manifest cached'); manifest = await getManifest(auth); } - console.log('didnt fail898998'); + core.info(`matching ${versionSpec}...`); const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch); From 3a18a011257c9fc49e794adfa30cee2fd84bd9d3 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Mon, 5 Dec 2022 23:08:49 +0100 Subject: [PATCH 4/4] format code --- src/installer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer.ts b/src/installer.ts index 0062e76fb..fdcfd8198 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -213,7 +213,7 @@ export async function getInfoFromManifest( core.debug('No manifest cached'); manifest = await getManifest(auth); } - + core.info(`matching ${versionSpec}...`); const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch);