@@ -61441,6 +61441,14 @@ function resolveVersionFromManifest(versionSpec, stable, auth, arch, manifest) {
61441
61441
}
61442
61442
});
61443
61443
}
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
+ }
61444
61452
function installGoVersion(info, auth, arch) {
61445
61453
return __awaiter(this, void 0, void 0, function* () {
61446
61454
core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
@@ -61455,10 +61463,21 @@ function installGoVersion(info, auth, arch) {
61455
61463
if (info.type === 'dist') {
61456
61464
extPath = path.join(extPath, 'go');
61457
61465
}
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);
61462
61481
});
61463
61482
}
61464
61483
function extractGoArchive(archivePath) {
0 commit comments