From 13a76d37423d461e9a6dc15071a57de35e7d5ff0 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Thu, 25 Jul 2024 16:36:36 +0800 Subject: [PATCH] feat: add arch to cache key --- dist/setup/index.js | 3 ++- src/cache-restore.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 405862d..3bfc535 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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)(); diff --git a/src/cache-restore.ts b/src/cache-restore.ts index a9763e0..90560c8 100644 --- a/src/cache-restore.ts +++ b/src/cache-restore.ts @@ -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);