add cache key

This commit is contained in:
ruki
2022-11-30 22:31:45 +08:00
Unverified
parent f8107700be
commit f7b19c868b
4 changed files with 23 additions and 2 deletions
+5 -1
View File
@@ -70848,10 +70848,14 @@ async function unixInstall(version) {
var _a;
let toolDir = '';
const actionsCacheFolder = core.getInput('actions-cache-folder');
let actionsCacheKey = core.getInput('actions-cache-key');
if (!actionsCacheKey) {
actionsCacheKey = '';
}
if (version.type !== 'local') {
const ver = version.version;
const sha = version.sha;
const cacheKey = `xmake-cache-${ver}-${sha}-${os.arch()}-${os.platform()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${os.arch()}-${os.platform()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {