fix: sync .complete marker when caching tools on windows

This commit is contained in:
Piotr Galar 2023-08-12 23:31:51 +02:00 committed by galargh
parent aabcd82874
commit 89a192af9d
2 changed files with 9 additions and 0 deletions

4
dist/setup/index.js vendored
View file

@ -61514,6 +61514,10 @@ function cacheWindowsDir(extPath, tool, version, arch) {
fs_1.default.mkdirSync(path.dirname(defaultToolCacheDir), { recursive: true });
fs_1.default.symlinkSync(actualToolCacheDir, defaultToolCacheDir, 'junction');
core.info(`Created link ${defaultToolCacheDir} => ${actualToolCacheDir}`);
const actualToolCacheCompleteFile = `${actualToolCacheDir}.complete`;
const defaultToolCacheCompleteFile = `${defaultToolCacheDir}.complete`;
fs_1.default.symlinkSync(actualToolCacheCompleteFile, defaultToolCacheCompleteFile, 'file');
core.info(`Created link ${defaultToolCacheCompleteFile} => ${actualToolCacheCompleteFile}`);
// make outer code to continue using toolcache as if it were installed on c:
// restore toolcache root to default drive c:
process.env['RUNNER_TOOL_CACHE'] = defaultToolCacheRoot;

View file

@ -203,6 +203,11 @@ async function cacheWindowsDir(
fs.symlinkSync(actualToolCacheDir, defaultToolCacheDir, 'junction');
core.info(`Created link ${defaultToolCacheDir} => ${actualToolCacheDir}`);
const actualToolCacheCompleteFile = `${actualToolCacheDir}.complete`;
const defaultToolCacheCompleteFile = `${defaultToolCacheDir}.complete`;
fs.symlinkSync(actualToolCacheCompleteFile, defaultToolCacheCompleteFile, 'file');
core.info(`Created link ${defaultToolCacheCompleteFile} => ${actualToolCacheCompleteFile}`);
// make outer code to continue using toolcache as if it were installed on c:
// restore toolcache root to default drive c:
process.env['RUNNER_TOOL_CACHE'] = defaultToolCacheRoot;