Compare commits
16 Commits
@@ -11,14 +11,14 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, windows-11-arm, macOS-latest]
|
||||
version: [latest, branch@master, branch@dev]
|
||||
os: [macOS-latest, macos-14, macos-13]
|
||||
version: [branch@test]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
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 }}
|
||||
actions-cache-folder: '.xmake-cache'
|
||||
@@ -31,6 +31,7 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
sw_vers -productVersion
|
||||
xmake --version
|
||||
cd tests/sample
|
||||
xmake -y -vD
|
||||
|
||||
Vendored
+52258
-55202
File diff suppressed because one or more lines are too long
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "github-action-setup-xmake",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "github-action-setup-xmake",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.3",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "github-action-setup-xmake",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Set up your GitHub Actions workflow with a specific version of xmake",
|
||||
"main": "dist/index.js",
|
||||
"author": "OpportunityLiu",
|
||||
|
||||
+32
-5
@@ -10,10 +10,35 @@ import * as semver from 'semver';
|
||||
import * as git from './git';
|
||||
import { Version } from './interfaces';
|
||||
|
||||
async function getPlatformIdentifier(): Promise<string> {
|
||||
let identifier = `${os.platform()}-${os.arch()}-${process.env.RUNNER_OS ?? 'unknown'}`;
|
||||
if (os.platform() === 'darwin') {
|
||||
let productVersion = '';
|
||||
try {
|
||||
await exec('sw_vers', ['-productVersion'], {
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
productVersion = data.toString().trim();
|
||||
},
|
||||
},
|
||||
});
|
||||
if (productVersion) {
|
||||
identifier += `-${productVersion}`;
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
core.warning(
|
||||
`Failed to get macOS product version: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return identifier;
|
||||
}
|
||||
|
||||
async function install(sourceDir: string, binDir: string): Promise<void> {
|
||||
if (fs.existsSync(path.join(sourceDir, 'configure'))) {
|
||||
await exec('sh', ['./configure'], { cwd: sourceDir });
|
||||
await exec('make', ['-j6'], { cwd: sourceDir });
|
||||
await exec('make', ['-j6', 'VERBOSE=1'], { cwd: sourceDir });
|
||||
await exec('make', ['install', `PREFIX=${binDir}`], { cwd: sourceDir });
|
||||
} else {
|
||||
await exec('make', ['-j6'], { cwd: sourceDir });
|
||||
@@ -32,9 +57,8 @@ export async function unixInstall(version: Version): Promise<void> {
|
||||
if (version.type !== 'local') {
|
||||
const ver = version.version;
|
||||
const sha = version.sha;
|
||||
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${os.arch()}-${os.platform()}-${
|
||||
process.env.RUNNER_OS ?? 'unknown'
|
||||
}`;
|
||||
const platformIdentifier = await getPlatformIdentifier();
|
||||
const cacheKey = `xmake-cache-${actionsCacheKey}-${ver}-${sha}-${platformIdentifier}`;
|
||||
|
||||
if (actionsCacheFolder && process.env.GITHUB_WORKSPACE) {
|
||||
const fullCachePath = path.join(process.env.GITHUB_WORKSPACE, actionsCacheFolder);
|
||||
@@ -48,7 +72,7 @@ export async function unixInstall(version: Version): Promise<void> {
|
||||
toolDir = fullCachePath;
|
||||
core.info(`cache path: ${toolDir}, key: ${cacheKey}`);
|
||||
} catch {
|
||||
core.warning(`No cached files found at path "${fullCachePath}".`);
|
||||
core.warning(`No cached files found at path "${fullCachePath}, key: ${cacheKey}".`);
|
||||
await io.rmRF(fullCachePath);
|
||||
}
|
||||
} else {
|
||||
@@ -92,4 +116,7 @@ export async function unixInstall(version: Version): Promise<void> {
|
||||
} else {
|
||||
core.addPath(path.join(toolDir, 'share', 'xmake')); // only for <= 2.3.1
|
||||
}
|
||||
|
||||
// xmake l utils.binary.deplibs /Users/ruki/.local/bin/xmake
|
||||
await exec(`xmake l --root utils.binary.deplibs ${path.join(toolDir, 'bin', 'xmake')}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user