mirror of
https://github.com/actions/setup-go.git
synced 2025-12-18 21:47:07 +00:00
Unique primaryKey for cache based on buildTargetArch
This commit is contained in:
parent
c0137caad7
commit
af7fba4129
4 changed files with 16 additions and 6 deletions
|
|
@ -11,7 +11,8 @@ import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils';
|
|||
export const restoreCache = async (
|
||||
versionSpec: string,
|
||||
packageManager: string,
|
||||
cacheDependencyPath?: string
|
||||
cacheDependencyPath?: string,
|
||||
buildTarget?: string
|
||||
) => {
|
||||
const packageManagerInfo = await getPackageManagerInfo(packageManager);
|
||||
const platform = process.env.RUNNER_OS;
|
||||
|
|
@ -32,7 +33,9 @@ export const restoreCache = async (
|
|||
|
||||
const linuxVersion =
|
||||
process.env.RUNNER_OS === 'Linux' ? `${process.env.ImageOS}-` : '';
|
||||
const primaryKey = `setup-go-${platform}-${arch}-${linuxVersion}go-${versionSpec}-${fileHash}`;
|
||||
const sanitizedBuildTarget = buildTarget?.trim();
|
||||
const targetSegment = sanitizedBuildTarget ? `${sanitizedBuildTarget}-` : '';
|
||||
const primaryKey = `setup-go-${platform}-${arch}-${targetSegment}${linuxVersion}go-${versionSpec}-${fileHash}`;
|
||||
core.debug(`primary key is ${primaryKey}`);
|
||||
|
||||
core.saveState(State.CachePrimaryKey, primaryKey);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue