improve cache key

This commit is contained in:
ruki
2025-08-21 12:17:42 +08:00
Unverified
parent 5d3a04c683
commit eb8f4402d4
6 changed files with 80 additions and 58 deletions
+3 -3
View File
@@ -9,6 +9,7 @@ import * as path from 'path';
import * as semver from 'semver';
import * as git from './git';
import { Version, GitVersion } from './interfaces';
import { getPlatformIdentifier } from './system';
function getInstallerUrl(version: GitVersion, latest: GitVersion): string {
let ver = version.version;
@@ -59,9 +60,8 @@ export async function winInstall(version: Version, latest: Version): Promise<voi
const ver = version.version;
const sha = version.sha;
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${os.arch()}-${os.platform()}-${
process.env.RUNNER_OS ?? 'unknown'
}`;
const platformIdentifier = await getPlatformIdentifier();
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
let toolDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {