@@ -61441,6 +61441,14 @@ function resolveVersionFromManifest(versionSpec, stable, auth, arch, manifest) {
6144161441 }
6144261442 });
6144361443}
61444+ function addExecutablesToCache(extPath, info, arch) {
61445+ return __awaiter(this, void 0, void 0, function* () {
61446+ core.info('Adding to the cache ...');
61447+ const cachedDir = yield tc.cacheDir(extPath, 'go', makeSemver(info.resolvedVersion), arch);
61448+ core.info(`Successfully cached go to ${cachedDir}`);
61449+ return cachedDir;
61450+ });
61451+ }
6144461452function installGoVersion(info, auth, arch) {
6144561453 return __awaiter(this, void 0, void 0, function* () {
6144661454 core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
@@ -61455,10 +61463,21 @@ function installGoVersion(info, auth, arch) {
6145561463 if (info.type === 'dist') {
6145661464 extPath = path.join(extPath, 'go');
6145761465 }
61458- core.info('Adding to the cache ...');
61459- const cachedDir = yield tc.cacheDir(extPath, 'go', makeSemver(info.resolvedVersion), arch);
61460- core.info(`Successfully cached go to ${cachedDir}`);
61461- return cachedDir;
61466+ if (isWindows) {
61467+ const oldCacheDir = process.env['RUNNER_TOOL_CACHE'] || '';
61468+ const tempCacheDir = oldCacheDir.replace('C:', 'D:').replace('c:', 'd:');
61469+ process.env['RUNNER_TOOL_CACHE'] = tempCacheDir;
61470+ const cachedDir = yield addExecutablesToCache(extPath, info, arch);
61471+ const lnkDest = cachedDir;
61472+ const lnkSrc = lnkDest.replace(tempCacheDir, oldCacheDir);
61473+ const lnkSrcDir = path.dirname(lnkSrc);
61474+ fs_1.default.mkdirSync(lnkSrcDir, { recursive: true });
61475+ fs_1.default.symlinkSync(lnkDest, lnkSrc, 'junction');
61476+ core.info(`Created link ${lnkSrc} => ${lnkDest}`);
61477+ process.env['RUNNER_TOOL_CACHE'] = oldCacheDir;
61478+ return cachedDir.replace(tempCacheDir, oldCacheDir);
61479+ }
61480+ return yield addExecutablesToCache(extPath, info, arch);
6146261481 });
6146361482}
6146461483function extractGoArchive(archivePath) {
0 commit comments