feat: add arch to cache key

This commit is contained in:
Zxilly 2024-07-25 16:36:36 +08:00
parent 6bd8b7f777
commit 13a76d3742
No known key found for this signature in database
GPG Key ID: 47AB1DEC841BC6A2
2 changed files with 4 additions and 2 deletions

3
dist/setup/index.js vendored
View File

@ -93479,7 +93479,8 @@ const restoreCache = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0,
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
}
const platform = process.env.RUNNER_OS;
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
const arch = process.arch;
const primaryKey = `dotnet-cache-${platform}-${arch}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
const { 'global-packages': cachePath } = yield (0, cache_utils_1.getNuGetFolderPath)();

View File

@ -17,7 +17,8 @@ export const restoreCache = async (cacheDependencyPath?: string) => {
}
const platform = process.env.RUNNER_OS;
const primaryKey = `dotnet-cache-${platform}-${fileHash}`;
const arch = process.arch;
const primaryKey = `dotnet-cache-${platform}-${arch}-${fileHash}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(State.CachePrimaryKey, primaryKey);