@@ -70512,9 +70512,9 @@ const core = __nccwpck_require__(7484);
7051270512const exec_1 = __nccwpck_require__(5236);
7051370513const io = __nccwpck_require__(4994);
7051470514const cache = __nccwpck_require__(5116);
70515- const os = __nccwpck_require__(857);
7051670515const path = __nccwpck_require__(6928);
7051770516const fsutils = __nccwpck_require__(7999);
70517+ const system_1 = __nccwpck_require__(7666);
7051870518function getBuildTime(hours) {
7051970519 let key = 'BuildTime';
7052070520 if (hours && hours !== '') {
@@ -70545,16 +70545,16 @@ function getProjectRootPath() {
7054570545 }
7054670546 return projectRootPath;
7054770547}
70548- function getBuildCacheKey(buildCacheTime) {
70549- var _a;
70548+ async function getBuildCacheKey(buildCacheTime) {
7055070549 let buildCacheKey = core.getInput('build-cache-key');
7055170550 if (!buildCacheKey) {
7055270551 buildCacheKey = '';
7055370552 }
7055470553 if (!buildCacheTime || buildCacheTime === '') {
7055570554 buildCacheTime = getBuildTime();
7055670555 }
70557- return `xmake-build-cache-${buildCacheKey}-${buildCacheTime}-${os.arch()}-${os.platform()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
70556+ const platformIdentifier = await (0, system_1.getPlatformIdentifier)();
70557+ return `xmake-build-cache-${buildCacheKey}-${buildCacheTime}-${platformIdentifier}`;
7055870558}
7055970559async function getBuildCachePath() {
7056070560 let buildCachePath = core.getInput('build-cache-path');
@@ -70611,7 +70611,7 @@ async function loadBuildCache() {
7061170611 if (hours < 0) {
7061270612 break;
7061370613 }
70614- const buildCacheKey = getBuildCacheKey(getBuildTime(String(hours).padStart(2, '0')));
70614+ const buildCacheKey = await getBuildCacheKey(getBuildTime(String(hours).padStart(2, '0')));
7061570615 if (!fsutils.isFile(filepath)) {
7061670616 core.info(`Restore build cache path: ${fullCachePath} to ${buildCachePath}, key: ${buildCacheKey}`);
7061770617 await cache.restoreCache([buildCacheFolder], buildCacheKey);
@@ -70644,7 +70644,7 @@ async function saveBuildCache() {
7064470644 return;
7064570645 }
7064670646 const buildCacheFolder = getBuildCacheFolder();
70647- const buildCacheKey = getBuildCacheKey();
70647+ const buildCacheKey = await getBuildCacheKey();
7064870648 const buildCachePath = await getBuildCachePath();
7064970649 const hitBuildCache = !!core.getState('hitBuildCache');
7065070650 if (!hitBuildCache && buildCacheFolder && process.env.GITHUB_WORKSPACE && fsutils.isDir(buildCachePath)) {
@@ -70832,9 +70832,9 @@ const core = __nccwpck_require__(7484);
7083270832const exec_1 = __nccwpck_require__(5236);
7083370833const io = __nccwpck_require__(4994);
7083470834const cache = __nccwpck_require__(5116);
70835- const os = __nccwpck_require__(857);
7083670835const path = __nccwpck_require__(6928);
7083770836const fsutils = __nccwpck_require__(7999);
70837+ const system_1 = __nccwpck_require__(7666);
7083870838function getProjectRootPath() {
7083970839 let projectRootPath = core.getInput('project-path');
7084070840 if (!projectRootPath) {
@@ -70847,7 +70847,6 @@ function getProjectRootPath() {
7084770847 return projectRootPath;
7084870848}
7084970849async function getPackageCacheKey() {
70850- var _a;
7085170850 let packageCacheKey = core.getInput('package-cache-key');
7085270851 if (!packageCacheKey) {
7085370852 packageCacheKey = '';
@@ -70870,7 +70869,8 @@ async function getPackageCacheKey() {
7087070869 await (0, exec_1.exec)('xmake', ['l', 'utils.ci.packageskey'], options);
7087170870 packageCacheHash = packageCacheHash.trim();
7087270871 }
70873- return `xmake-package-cache-${packageCacheKey}-${packageCacheHash}-${os.arch()}-${os.platform()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
70872+ const platformIdentifier = await (0, system_1.getPlatformIdentifier)();
70873+ return `xmake-package-cache-${packageCacheKey}-${packageCacheHash}-${platformIdentifier}`;
7087470874}
7087570875async function getPackageCachePath() {
7087670876 let packageCachePath = '';
@@ -70976,23 +70976,16 @@ if (!exports.IsPost) {
7097670976
7097770977/***/ }),
7097870978
70979- /***/ 9095 :
70979+ /***/ 7666 :
7098070980/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7098170981
7098270982"use strict";
7098370983
7098470984Object.defineProperty(exports, "__esModule", ({ value: true }));
70985- exports.unixInstall = unixInstall ;
70985+ exports.getPlatformIdentifier = getPlatformIdentifier ;
7098670986const core = __nccwpck_require__(7484);
7098770987const exec_1 = __nccwpck_require__(5236);
70988- const io = __nccwpck_require__(4994);
70989- const toolCache = __nccwpck_require__(3472);
70990- const cache = __nccwpck_require__(5116);
7099170988const os = __nccwpck_require__(857);
70992- const fs = __nccwpck_require__(9896);
70993- const path = __nccwpck_require__(6928);
70994- const semver = __nccwpck_require__(2088);
70995- const git = __nccwpck_require__(1243);
7099670989async function getPlatformIdentifier() {
7099770990 var _a;
7099870991 let identifier = `${os.platform()}-${os.arch()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
@@ -71017,6 +71010,28 @@ async function getPlatformIdentifier() {
7101771010 }
7101871011 return identifier;
7101971012}
71013+
71014+
71015+ /***/ }),
71016+
71017+ /***/ 9095:
71018+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
71019+
71020+ "use strict";
71021+
71022+ Object.defineProperty(exports, "__esModule", ({ value: true }));
71023+ exports.unixInstall = unixInstall;
71024+ const core = __nccwpck_require__(7484);
71025+ const exec_1 = __nccwpck_require__(5236);
71026+ const io = __nccwpck_require__(4994);
71027+ const toolCache = __nccwpck_require__(3472);
71028+ const cache = __nccwpck_require__(5116);
71029+ const os = __nccwpck_require__(857);
71030+ const fs = __nccwpck_require__(9896);
71031+ const path = __nccwpck_require__(6928);
71032+ const semver = __nccwpck_require__(2088);
71033+ const git = __nccwpck_require__(1243);
71034+ const system_1 = __nccwpck_require__(7666);
7102071035async function install(sourceDir, binDir) {
7102171036 if (fs.existsSync(path.join(sourceDir, 'configure'))) {
7102271037 await (0, exec_1.exec)('sh', ['./configure'], { cwd: sourceDir });
@@ -71038,7 +71053,7 @@ async function unixInstall(version) {
7103871053 if (version.type !== 'local') {
7103971054 const ver = version.version;
7104071055 const sha = version.sha;
71041- const platformIdentifier = await getPlatformIdentifier();
71056+ const platformIdentifier = await (0, system_1. getPlatformIdentifier) ();
7104271057 const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
7104371058 if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
7104471059 const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
@@ -71287,6 +71302,7 @@ const fs = __nccwpck_require__(9896);
7128771302const path = __nccwpck_require__(6928);
7128871303const semver = __nccwpck_require__(2088);
7128971304const git = __nccwpck_require__(1243);
71305+ const system_1 = __nccwpck_require__(7666);
7129071306function getInstallerUrl(version, latest) {
7129171307 let ver = version.version;
7129271308 switch (version.type) {
@@ -71322,7 +71338,6 @@ async function installFromSource(xmakeBin, sourceDir, binDir) {
7132271338 await (0, exec_1.exec)(xmakeBin, ['install', '-o', binDir, 'cli'], { cwd: sourceDir });
7132371339}
7132471340async function winInstall(version, latest) {
71325- var _a;
7132671341 if (version.type === 'local' || latest.type === 'local') {
7132771342 throw new Error('Local builds for windows is not supported');
7132871343 }
@@ -71333,22 +71348,23 @@ async function winInstall(version, latest) {
7133371348 }
7133471349 const ver = version.version;
7133571350 const sha = version.sha;
71336- const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${os.arch()}-${os.platform()}-${(_a = process.env.RUNNER_OS) !== null && _a !== void 0 ? _a : 'unknown'}`;
71351+ const platformIdentifier = await (0, system_1.getPlatformIdentifier)();
71352+ const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
7133771353 let toolDir = '';
7133871354 if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
7133971355 const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
7134071356 try {
7134171357 try {
7134271358 fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
7134371359 }
71344- catch (_b ) {
71360+ catch (_a ) {
7134571361 await cache.restoreCache([actionsCacheFolder], cacheKey);
7134671362 }
7134771363 fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
7134871364 toolDir = fullCachePath;
7134971365 core.info(`cache path: ${toolDir}, key: ${cacheKey}`);
7135071366 }
71351- catch (_c ) {
71367+ catch (_b ) {
7135271368 core.warning(`No cached files found at path "${fullCachePath}".`);
7135371369 await io.rmRF(fullCachePath);
7135471370 }
0 commit comments