Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 9, 2024
1 parent 65def61 commit 5f199a9
Show file tree
Hide file tree
Showing 6 changed files with 8,929 additions and 2,304 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ jobs:
checkin:
runs-on: ubuntu-latest

concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-checkin
cancel-in-progress: true

steps:
- uses: actions/checkout@v4
- name: install
uses: wyvox/action-setup-pnpm@v3
with:
node-version: 20
pnpm-version: 8
node-version: 23
pnpm-version: 9
- name: build
run: pnpm build
- name: test
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:

jobs:
build:
concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-${{ matrix.os }}-${{ matrix.version }}-test
cancel-in-progress: true

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand All @@ -14,7 +18,7 @@ jobs:

steps:
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@master
- uses: xmake-io/github-action-setup-xmake@test
with:
xmake-version: ${{ matrix.version }}
- name: Run tests
Expand Down
34 changes: 34 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82830,6 +82830,7 @@ const toolCache = __nccwpck_require__(5561);
const os = __nccwpck_require__(2037);
const path = __nccwpck_require__(1017);
const semver = __nccwpck_require__(117);
const git = __nccwpck_require__(3555);
function getInstallerUrl(version, latest) {
const ver = version.version;
switch (version.type) {
Expand Down Expand Up @@ -82857,10 +82858,20 @@ function getInstallerUrl(version, latest) {
}
}
}
async function installFromSource(xmakeBin, sourceDir, binDir) {
await (0, exec_1.exec)(xmakeBin, ['-y'], { cwd: sourceDir });
await (0, exec_1.exec)(xmakeBin, ['install', '-o', binDir, 'cli'], { cwd: sourceDir });
}
async function winInstall(version, latest) {
if (version.type === 'local' || latest.type === 'local') {
throw new Error('Local builds for windows is not supported');
}
/*
const actionsCacheFolder = core.getInput('actions-cache-folder');
let actionsCacheKey = core.getInput('actions-cache-key');
if (!actionsCacheKey) {
actionsCacheKey = '';
}*/
const ver = version.version;
let toolDir = toolCache.find('xmake', ver);
if (!toolDir) {
Expand All @@ -82887,6 +82898,29 @@ async function winInstall(version, latest) {
await io.rmRF(installer);
return cacheDir;
});
await (0, exec_1.exec)(`"${toolDir}/xmake.exe" --version`);
if (version.type === 'heads') {
const sourceDir = await core.group(`download xmake source ${String(version)}`, () => git.create(version.repo, version.sha));
toolDir = await core.group(`install xmake source ${String(version)}`, async () => {
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
await installFromSource(`${toolDir}/xmake.exe`, `${sourceDir}/core`, binDir);
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
/*
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(binDir, cacheDir, {
recursive: true,
});
await cache.saveCache([actionsCacheFolder], cacheKey);
} else {
cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
}*/
await io.rmRF(binDir);
await git.cleanup(version.sha);
return cacheDir;
});
}
}
core.addPath(toolDir);
}
Expand Down
Loading

0 comments on commit 5f199a9

Please sign in to comment.