@@ -82830,6 +82830,7 @@ const toolCache = __nccwpck_require__(5561);
82830
82830
const os = __nccwpck_require__(2037);
82831
82831
const path = __nccwpck_require__(1017);
82832
82832
const semver = __nccwpck_require__(117);
82833
+ const git = __nccwpck_require__(3555);
82833
82834
function getInstallerUrl(version, latest) {
82834
82835
const ver = version.version;
82835
82836
switch (version.type) {
@@ -82857,10 +82858,20 @@ function getInstallerUrl(version, latest) {
82857
82858
}
82858
82859
}
82859
82860
}
82861
+ async function installFromSource(xmakeBin, sourceDir, binDir) {
82862
+ await (0, exec_1.exec)(xmakeBin, [], { cwd: sourceDir });
82863
+ await (0, exec_1.exec)(xmakeBin, ['install', '-o', binDir], { cwd: sourceDir });
82864
+ }
82860
82865
async function winInstall(version, latest) {
82861
82866
if (version.type === 'local' || latest.type === 'local') {
82862
82867
throw new Error('Local builds for windows is not supported');
82863
82868
}
82869
+ /*
82870
+ const actionsCacheFolder = core.getInput('actions-cache-folder');
82871
+ let actionsCacheKey = core.getInput('actions-cache-key');
82872
+ if (!actionsCacheKey) {
82873
+ actionsCacheKey = '';
82874
+ }*/
82864
82875
const ver = version.version;
82865
82876
let toolDir = toolCache.find('xmake', ver);
82866
82877
if (!toolDir) {
@@ -82887,6 +82898,29 @@ async function winInstall(version, latest) {
82887
82898
await io.rmRF(installer);
82888
82899
return cacheDir;
82889
82900
});
82901
+ await (0, exec_1.exec)(`"${toolDir}/xmake.exe" --version`);
82902
+ if (version.type === 'heads') {
82903
+ const sourceDir = await core.group(`download xmake source ${String(version)}`, () => git.create(version.repo, version.sha));
82904
+ toolDir = await core.group(`install xmake source ${String(version)}`, async () => {
82905
+ const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
82906
+ await installFromSource(`${toolDir}/xmake.exe`, `${sourceDir}/core`, binDir);
82907
+ const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
82908
+ /*
82909
+ let cacheDir = '';
82910
+ if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
82911
+ cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
82912
+ await io.cp(binDir, cacheDir, {
82913
+ recursive: true,
82914
+ });
82915
+ await cache.saveCache([actionsCacheFolder], cacheKey);
82916
+ } else {
82917
+ cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
82918
+ }*/
82919
+ await io.rmRF(binDir);
82920
+ await git.cleanup(version.sha);
82921
+ return cacheDir;
82922
+ });
82923
+ }
82890
82924
}
82891
82925
core.addPath(toolDir);
82892
82926
}
0 commit comments