Compare commits

...

12 Commits

9 changed files with 347 additions and 416 deletions
+5 -3
View File
@@ -13,12 +13,12 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: install
uses: wyvox/action-setup-pnpm@v3
with:
node-version: 23
pnpm-version: 9
node-version: 24
pnpm-version: 10
- name: build
run: pnpm build
- name: test
@@ -28,6 +28,8 @@ 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."
+25 -5
View File
@@ -17,21 +17,41 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v6
- uses: xmake-io/github-action-setup-xmake@master
with:
xmake-version: ${{ matrix.version }}
actions-cache-folder: '.xmake-cache'
actions-cache-key: ${{ matrix.version }}
actions-cache-key: ${{ matrix.version }}-relative
build-cache: true
build-cache-key: ${{ matrix.version }}
build-cache-key: ${{ matrix.version }}-relative
package-cache: true
package-cache-key: ${{ matrix.version }}
package-cache-key: ${{ matrix.version }}-relative
project-path: 'tests/sample'
- name: Run tests
- name: Run tests with relative cache path
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
@@ -36,6 +36,6 @@ inputs:
default: ''
runs:
using: 'node20'
using: 'node24'
main: 'dist/index.js'
post: 'dist/index.js'
+4 -4
View File
@@ -71069,7 +71069,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.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'bin', 'xmake'), fs.constants.X_OK);
@@ -71096,7 +71096,7 @@ async function unixInstall(version) {
await install(sourceDir, binDir);
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(binDir, cacheDir, {
recursive: true,
});
@@ -71383,7 +71383,7 @@ async function winInstall(version) {
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
let toolDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
@@ -71442,7 +71442,7 @@ async function winInstall(version) {
if (toolDir) {
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.resolve(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.3",
"version": "1.2.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "github-action-setup-xmake",
"version": "1.2.3",
"version": "1.2.5",
"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.3",
"version": "1.2.5",
"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://github.com/xmake-io/github-action-setup-xmake.git",
"homepage": "https://github.com/xmake-io/github-action-setup-xmake",
"repository": "https://git.soulmc.cn/wed15/github-action-setup-xmake.git",
"homepage": "https://git.soulmc.cn/wed15/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": "^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"
"@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"
},
"devDependencies": {
"@types/jest": "^29.5.12",
+294 -385
View File
File diff suppressed because it is too large Load Diff
+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.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.resolve(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.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(binDir, cacheDir, {
recursive: true,
});
+5 -5
View File
@@ -23,7 +23,7 @@ async function getInstallerUrl(version: GitVersion, _fallback: boolean = false):
if (vers !== 'dev' && vers !== 'master') {
vers = latestVers;
}
finalUrl = `https://github.com/xmake-io/xmake/releases/download/${latestVers}/xmake-${vers}.${arch}.exe`;
finalUrl = `https://github.bibk.top/xmake-io/xmake/releases/download/${latestVers}/xmake-${vers}.${arch}.exe`;
break;
}
case 'pull': {
@@ -35,8 +35,8 @@ 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.com/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.${arch}.exe`
: `https://github.com/xmake-io/xmake/releases/download/${vers}/xmake-${vers}.exe`;
? `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;
}
default: {
@@ -85,7 +85,7 @@ export async function winInstall(version: Version): Promise<void> {
let toolDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
const fullCachePath = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
try {
try {
fs.accessSync(path.join(fullCachePath, 'xmake.exe'), fs.constants.X_OK);
@@ -146,7 +146,7 @@ export async function winInstall(version: Version): Promise<void> {
if (toolDir) {
let cacheDir = '';
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
cacheDir = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
cacheDir = path.resolve(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
await io.cp(toolDir, cacheDir, {
recursive: true,
});