Compare commits

..

1 Commits

13 changed files with 479 additions and 475 deletions
+3 -5
View File
@@ -13,12 +13,12 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- name: install
uses: wyvox/action-setup-pnpm@v3
with:
node-version: 24
pnpm-version: 10
node-version: 23
pnpm-version: 9
- name: build
run: pnpm build
- name: test
@@ -28,8 +28,6 @@ jobs:
- name: 'check for uncommitted changes'
# Ensure no changes
run: |
pnpm --version
node --version
git add .
if ! git diff --cached --color=always --exit-code -- . ':!node_modules'; then
echo "::error::Found changed files after build. Please run 'pnpm release' and check in all changes."
+5 -25
View File
@@ -17,41 +17,21 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@master
with:
xmake-version: ${{ matrix.version }}
actions-cache-folder: '.xmake-cache'
actions-cache-key: ${{ matrix.version }}-relative
actions-cache-key: ${{ matrix.version }}
build-cache: true
build-cache-key: ${{ matrix.version }}-relative
build-cache-key: ${{ matrix.version }}
package-cache: true
package-cache-key: ${{ matrix.version }}-relative
package-cache-key: ${{ matrix.version }}
project-path: 'tests/sample'
- name: Run tests with relative cache path
- name: Run tests
run: |
xmake --version
cd tests/sample
xmake -y -vD
xmake run
xmake clean
- uses: xmake-io/github-action-setup-xmake@master
with:
xmake-version: ${{ matrix.version }}
actions-cache-folder: '${{ runner.temp }}/xmake-cache'
actions-cache-key: ${{ matrix.version }}-absolute
build-cache: true
build-cache-key: ${{ matrix.version }}-absolute
package-cache: true
package-cache-key: ${{ matrix.version }}-absolute
project-path: 'tests/sample'
- name: Run tests with absolute cache path
run: |
xmake --version
cd tests/sample
xmake -y -vD
xmake run
xmake clean
+1 -1
View File
@@ -142,6 +142,6 @@ git branch test
git checkout test
pnpm build
pnpm release
git commit -a -m "..."
git-commit -a -m "..."
git push origin test
```
+1 -1
View File
@@ -36,6 +36,6 @@ inputs:
default: ''
runs:
using: 'node24'
using: 'node20'
main: 'dist/index.js'
post: 'dist/index.js'
+42 -73
View File
@@ -70713,7 +70713,6 @@ const exec_1 = __nccwpck_require__(5236);
const io = __nccwpck_require__(4994);
const os = __nccwpck_require__(857);
const path = __nccwpck_require__(6928);
const semver_1 = __nccwpck_require__(2088);
function makeOpt(ref) {
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
}
@@ -70728,38 +70727,25 @@ async function lsRemote(repo) {
});
const data = { heads: {}, tags: {}, pull: {} };
out.split('\n').forEach((line) => {
const [ref, path] = line.trim().split('\t');
if (ref && (path === null || path === void 0 ? void 0 : path.startsWith('refs/'))) {
const tagPath = path.split('/').splice(1);
switch (tagPath[0]) {
case 'heads': {
// refs/heads/copilot/fix-6807
const head = tagPath.slice(1).join('/');
data.heads[head] = ref;
break;
const [ref, tag] = line.trim().split('\t');
if (ref && (tag === null || tag === void 0 ? void 0 : tag.startsWith('refs/'))) {
const tagPath = tag.split('/').splice(1);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let ldata = data; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
for (let i = 0; i < tagPath.length - 1; i++) {
const seg = tagPath[i];
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (typeof ldata[seg] === 'object') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata = ldata[seg]; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
}
case 'pull': {
// refs/pull/11/head
// refs/pull/11/merge
const pr = Number(tagPath[1]);
if (!data.pull[pr]) {
data.pull[pr] = {};
else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata = ldata[seg] = {};
}
data.pull[pr][tagPath[2]] = ref;
break;
}
case 'tags': {
// refs/tags/preview
// refs/tags/v3.0.3
const tag = tagPath.slice(1).join('/');
if ((0, semver_1.valid)(tag)) {
data.tags[tag] = ref;
}
break;
}
default:
break;
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata[tagPath[tagPath.length - 1]] = ref;
}
});
return data;
@@ -70798,7 +70784,8 @@ const unix_install_1 = __nccwpck_require__(9095);
async function installXmake() {
const version = await (0, versions_1.selectVersion)();
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
await (0, win_install_1.winInstall)(version);
const latest = await (0, versions_1.selectVersion)('latest');
await (0, win_install_1.winInstall)(version, latest);
}
else {
await (0, unix_install_1.unixInstall)(version);
@@ -71069,7 +71056,7 @@ async function unixInstall(version) {
const platformIdentifier = await (0, system_1.getPlatformIdentifier)();
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'bin', 'xmake'), fs.constants.X_OK);
@@ -71096,7 +71083,7 @@ async function unixInstall(version) {
await install(sourceDir, binDir);
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(binDir, cacheDir, {
recursive: true,
});
@@ -71239,9 +71226,9 @@ async function selectSha(repo, sha) {
return selectPr(repo, Number.parseInt(pr));
}
}
return Promise.resolve(new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substring(0, 8)}`));
return Promise.resolve(new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`));
}
async function selectVersion(version, _fallback = false) {
async function selectVersion(version) {
// get version string
version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest';
if (version.toLowerCase() === 'latest')
@@ -71262,20 +71249,20 @@ async function selectVersion(version, _fallback = false) {
}
// select branch
if (version.startsWith('branch@')) {
const branch = version.substring('branch@'.length);
const branch = version.substr('branch@'.length);
ret = await selectBranch(repo, branch);
}
// select pr
if (version.startsWith('pr@')) {
const pr = Number.parseInt(version.substring('pr@'.length));
const pr = Number.parseInt(version.substr('pr@'.length));
if (Number.isNaN(pr) || pr <= 0) {
throw new Error(`Invalid pull requrest ${version.substring('pr@'.length)}, should be a positive integer`);
throw new Error(`Invalid pull requrest ${version.substr('pr@'.length)}, should be a positive integer`);
}
ret = await selectPr(repo, pr);
}
// select sha
if (version.startsWith('sha@')) {
const sha = version.substring('sha@'.length);
const sha = version.substr('sha@'.length);
ret = await selectSha(repo, sha);
}
// select version
@@ -71288,8 +71275,8 @@ async function selectVersion(version, _fallback = false) {
if (ret.type === 'local') {
core.info(`Use local xmake at '${ret.path}'`);
}
else if (!_fallback) {
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substring(0, 8)})` +
else {
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''));
}
return ret;
@@ -71315,21 +71302,17 @@ const fs = __nccwpck_require__(9896);
const path = __nccwpck_require__(6928);
const semver = __nccwpck_require__(2088);
const git = __nccwpck_require__(1243);
const versions_1 = __nccwpck_require__(7902);
const system_1 = __nccwpck_require__(7666);
async function getInstallerUrl(version, _fallback = false) {
const latest = (await (0, versions_1.selectVersion)('latest', _fallback));
const latestVers = latest.version;
let vers = version.version;
let finalUrl;
function getInstallerUrl(version, latest) {
let ver = version.version;
switch (version.type) {
case 'heads': {
const arch = os.arch() === 'arm64' ? 'arm64' : os.arch() === 'x64' ? 'win64' : 'win32';
if (vers !== 'dev' && vers !== 'master') {
vers = latestVers;
const latestver = latest.version;
if (ver !== 'dev' && ver !== 'master') {
ver = latestver;
}
finalUrl = `https://github.com/xmake-io/xmake/releases/download/${latestVers}/xmake-${vers}.${arch}.exe`;
break;
return `https://github.com/xmake-io/xmake/releases/download/${latestver}/xmake-${ver}.${arch}.exe`;
}
case 'pull': {
throw new Error('PR builds for windows is not supported');
@@ -71339,10 +71322,9 @@ async function getInstallerUrl(version, _fallback = false) {
}
case 'tags': {
const arch = os.arch() === 'arm64' ? 'arm64' : os.arch() === 'x64' ? 'win64' : 'win32';
finalUrl = semver.gt(vers, '2.2.6')
? `https://github.com/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.${arch}.exe`
: `https://github.com/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.exe`;
break;
return semver.gt(ver, '2.2.6')
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
: `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`;
}
default: {
// check that we have tested all types
@@ -71350,26 +71332,13 @@ async function getInstallerUrl(version, _fallback = false) {
throw new Error('Unknown version type');
}
}
// check if the URL returns 404. If so, xmake may have just released a
// new version, causing some binaries to be temporarily unavailable, so
// we need to fallback to the previous version.
if (!_fallback) {
const head = await fetch(finalUrl, { method: 'HEAD' });
if (head.status === 404) {
const currentVers = latestVers || vers;
const previousVersion = (await (0, versions_1.selectVersion)('<' + currentVers));
core.warning(`The requested version ${currentVers} (${finalUrl}) resource is temporarily unavailable, trying to fallback to the previous version...`);
return await getInstallerUrl(previousVersion, true);
}
}
return finalUrl;
}
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) {
if (version.type === 'local') {
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');
@@ -71383,7 +71352,7 @@ async function winInstall(version) {
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
let toolDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
@@ -71405,7 +71374,7 @@ async function winInstall(version) {
}
if (!toolDir) {
const installer = await core.group(`download xmake ${String(version)}`, async () => {
const url = await getInstallerUrl(version);
const url = getInstallerUrl(version, latest);
core.info(`downloading from ${url}`);
const file = await toolCache.downloadTool(url);
const exe = path.format({
@@ -71442,7 +71411,7 @@ async function winInstall(version) {
if (toolDir) {
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(toolDir, cacheDir, {
recursive: true,
});
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "github-action-setup-xmake",
"version": "1.2.5",
"version": "1.2.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "github-action-setup-xmake",
"version": "1.2.5",
"version": "1.2.2",
"license": "GPL-3.0-or-later",
"dependencies": {
"@actions/cache": "^4.0.3",
+9 -9
View File
@@ -1,12 +1,12 @@
{
"name": "github-action-setup-xmake",
"version": "1.2.5",
"version": "1.2.2",
"description": "Set up your GitHub Actions workflow with a specific version of xmake",
"main": "dist/index.js",
"author": "OpportunityLiu",
"license": "GPL-3.0-or-later",
"repository": "https://git.soulmc.cn/wed15/github-action-setup-xmake.git",
"homepage": "https://git.soulmc.cn/wed15/github-action-setup-xmake",
"repository": "https://github.com/xmake-io/github-action-setup-xmake.git",
"homepage": "https://github.com/xmake-io/github-action-setup-xmake",
"scripts": {
"watch": "tsc --watch",
"build": "ncc build src/index.ts",
@@ -18,12 +18,12 @@
"release": "pnpm clean && pnpm format && pnpm lint && pnpm build"
},
"dependencies": {
"@actions/cache": "^5.0.5",
"@actions/core": "^2.0.3",
"@actions/exec": "^2.0.0",
"@actions/io": "^2.0.0",
"@actions/tool-cache": "^3.0.1",
"semver": "^7.7.4"
"@actions/cache": "^4.0.3",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.2",
"semver": "^7.7.2"
},
"devDependencies": {
"@types/jest": "^29.5.12",
+374 -283
View File
File diff suppressed because it is too large Load Diff
+16 -31
View File
@@ -3,7 +3,6 @@ import * as io from '@actions/io';
import * as os from 'os';
import * as path from 'path';
import { Sha, RefDic, Repo } from './interfaces';
import { valid as isValidSemver } from 'semver';
function makeOpt(ref: Sha): { cwd: string } {
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
@@ -21,38 +20,24 @@ export async function lsRemote(repo: Repo): Promise<RefDic> {
});
const data: RefDic = { heads: {}, tags: {}, pull: {} };
out.split('\n').forEach((line) => {
const [ref, path] = line.trim().split('\t') as [Sha, string];
if (ref && path?.startsWith('refs/')) {
const tagPath = path.split('/').splice(1);
switch (tagPath[0]) {
case 'heads': {
// refs/heads/copilot/fix-6807
const head = tagPath.slice(1).join('/');
data.heads[head] = ref;
break;
const [ref, tag] = line.trim().split('\t');
if (ref && tag?.startsWith('refs/')) {
const tagPath = tag.split('/').splice(1);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let ldata = data as any; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
for (let i = 0; i < tagPath.length - 1; i++) {
const seg = tagPath[i];
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (typeof ldata[seg] === 'object') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata = ldata[seg]; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata = ldata[seg] = {};
}
case 'pull': {
// refs/pull/11/head
// refs/pull/11/merge
const pr = Number(tagPath[1]);
if (!data.pull[pr]) {
data.pull[pr] = {} as RefDic['pull'][number];
}
data.pull[pr][tagPath[2] as 'head' | 'merge'] = ref;
break;
}
case 'tags': {
// refs/tags/preview
// refs/tags/v3.0.3
const tag = tagPath.slice(1).join('/');
if (isValidSemver(tag)) {
data.tags[tag] = ref;
}
break;
}
default:
break;
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata[tagPath[tagPath.length - 1]] = ref;
}
});
return data;
+2 -1
View File
@@ -7,7 +7,8 @@ import { unixInstall } from './unix-install';
export async function installXmake(): Promise<void> {
const version = await selectVersion();
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
await winInstall(version);
const latest = await selectVersion('latest');
await winInstall(version, latest);
} else {
await unixInstall(version);
}
+2 -2
View File
@@ -37,7 +37,7 @@ export async function unixInstall(version: Version): Promise<void> {
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'bin', 'xmake'), fs.constants.X_OK);
@@ -65,7 +65,7 @@ export async function unixInstall(version: Version): Promise<void> {
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(binDir, cacheDir, {
recursive: true,
});
+8 -8
View File
@@ -96,11 +96,11 @@ async function selectSha(repo: Repo, sha: string): Promise<Version> {
}
}
return Promise.resolve(
new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substring(0, 8)}`),
new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`),
);
}
export async function selectVersion(version?: string, _fallback: boolean = false): Promise<Version> {
export async function selectVersion(version?: string): Promise<Version> {
// get version string
version = (version ?? core.getInput('xmake-version')) || 'latest';
if (version.toLowerCase() === 'latest') version = '';
@@ -123,20 +123,20 @@ export async function selectVersion(version?: string, _fallback: boolean = false
// select branch
if (version.startsWith('branch@')) {
const branch = version.substring('branch@'.length);
const branch = version.substr('branch@'.length);
ret = await selectBranch(repo, branch);
}
// select pr
if (version.startsWith('pr@')) {
const pr = Number.parseInt(version.substring('pr@'.length));
const pr = Number.parseInt(version.substr('pr@'.length));
if (Number.isNaN(pr) || pr <= 0) {
throw new Error(`Invalid pull requrest ${version.substring('pr@'.length)}, should be a positive integer`);
throw new Error(`Invalid pull requrest ${version.substr('pr@'.length)}, should be a positive integer`);
}
ret = await selectPr(repo, pr);
}
// select sha
if (version.startsWith('sha@')) {
const sha = version.substring('sha@'.length);
const sha = version.substr('sha@'.length);
ret = await selectSha(repo, sha);
}
// select version
@@ -148,9 +148,9 @@ export async function selectVersion(version?: string, _fallback: boolean = false
}
if (ret.type === 'local') {
core.info(`Use local xmake at '${ret.path}'`);
} else if (!_fallback) {
} else {
core.info(
`Selected xmake ${String(ret)} (commit: ${ret.sha.substring(0, 8)})` +
`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''),
);
}
+14 -34
View File
@@ -9,22 +9,18 @@ import * as path from 'path';
import * as semver from 'semver';
import * as git from './git';
import { Version, GitVersion } from './interfaces';
import { selectVersion } from './versions';
import { getPlatformIdentifier } from './system';
async function getInstallerUrl(version: GitVersion, _fallback: boolean = false): Promise<string> {
const latest = (await selectVersion('latest', _fallback)) as GitVersion;
const latestVers = latest.version;
let vers = version.version;
let finalUrl: string;
function getInstallerUrl(version: GitVersion, latest: GitVersion): string {
let ver = version.version;
switch (version.type) {
case 'heads': {
const arch = os.arch() === 'arm64' ? 'arm64' : os.arch() === 'x64' ? 'win64' : 'win32';
if (vers !== 'dev' && vers !== 'master') {
vers = latestVers;
const latestver = latest.version;
if (ver !== 'dev' && ver !== 'master') {
ver = latestver;
}
finalUrl = `https://github.bibk.top/xmake-io/xmake/releases/download/${latestVers}/xmake-${vers}.${arch}.exe`;
break;
return `https://github.com/xmake-io/xmake/releases/download/${latestver}/xmake-${ver}.${arch}.exe`;
}
case 'pull': {
throw new Error('PR builds for windows is not supported');
@@ -34,10 +30,9 @@ async function getInstallerUrl(version: GitVersion, _fallback: boolean = false):
}
case 'tags': {
const arch = os.arch() === 'arm64' ? 'arm64' : os.arch() === 'x64' ? 'win64' : 'win32';
finalUrl = semver.gt(vers, '2.2.6')
? `https://github.bibk.top/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.${arch}.exe`
: `https://github.bibk.top/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.exe`;
break;
return semver.gt(ver, '2.2.6')
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
: `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`;
}
default: {
// check that we have tested all types
@@ -45,21 +40,6 @@ async function getInstallerUrl(version: GitVersion, _fallback: boolean = false):
throw new Error('Unknown version type');
}
}
// check if the URL returns 404. If so, xmake may have just released a
// new version, causing some binaries to be temporarily unavailable, so
// we need to fallback to the previous version.
if (!_fallback) {
const head = await fetch(finalUrl, { method: 'HEAD' });
if (head.status === 404) {
const currentVers = latestVers || vers;
const previousVersion = (await selectVersion('<' + currentVers)) as GitVersion;
core.warning(
`The requested version ${currentVers} (${finalUrl}) resource is temporarily unavailable, trying to fallback to the previous version...`,
);
return await getInstallerUrl(previousVersion, true);
}
}
return finalUrl;
}
async function installFromSource(xmakeBin: string, sourceDir: string, binDir: string): Promise<void> {
@@ -67,8 +47,8 @@ async function installFromSource(xmakeBin: string, sourceDir: string, binDir: st
await exec(xmakeBin, ['install', '-o', binDir, 'cli'], { cwd: sourceDir });
}
export async function winInstall(version: Version): Promise<void> {
if (version.type === 'local') {
export async function winInstall(version: Version, latest: Version): Promise<void> {
if (version.type === 'local' || latest.type === 'local') {
throw new Error('Local builds for windows is not supported');
}
@@ -85,7 +65,7 @@ export async function winInstall(version: Version): Promise<void> {
let toolDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
@@ -105,7 +85,7 @@ export async function winInstall(version: Version): Promise<void> {
if (!toolDir) {
const installer = await core.group(`download xmake ${String(version)}`, async () => {
const url = await getInstallerUrl(version);
const url = getInstallerUrl(version, latest);
core.info(`downloading from ${url}`);
const file = await toolCache.downloadTool(url);
const exe = path.format({
@@ -146,7 +126,7 @@ export async function winInstall(version: Version): Promise<void> {
if (toolDir) {
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(toolDir, cacheDir, {
recursive: true,
});