improve install

This commit is contained in:
ruki
2025-01-14 23:00:42 +08:00
Unverified
parent 0e6e37e867
commit 138e25abc8
5 changed files with 49 additions and 87545 deletions
+14
View File
@@ -0,0 +1,14 @@
import * as core from '@actions/core';
import { exec } from '@actions/exec';
import * as io from '@actions/io';
import * as toolCache from '@actions/tool-cache';
import * as cache from '@actions/cache';
import * as os from 'os';
import * as fs from 'fs';
import * as path from 'path';
export async function loadBuildCache(): Promise<void> {
}
export async function saveBuildCache(): Promise<void> {
}
+3 -22
View File
@@ -1,29 +1,10 @@
import * as core from '@actions/core';
import { exec } from '@actions/exec';
import * as os from 'os';
import { selectVersion } from './versions';
import * as stateHelper from './state-helper';
import { winInstall } from './win-install';
import { unixInstall } from './unix-install';
async function installXmake(): Promise<void> {
const version = await selectVersion();
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
const latest = await selectVersion('latest');
await winInstall(version, latest);
} else {
await unixInstall(version);
}
await exec('xmake --root --version');
}
async function loadBuildCache(): Promise<void> {}
async function loadPackagesCache(): Promise<void> {}
async function saveBuildCache(): Promise<void> {}
async function savePackagesCache(): Promise<void> {}
import { installXmake } from './install';
import { loadBuildCache, saveBuildCache } from './build-cache';
import { loadPackageCache, savePackageCache } from './package-cache';
async function run(): Promise<void> {
try {
+18
View File
@@ -0,0 +1,18 @@
import * as core from '@actions/core';
import { exec } from '@actions/exec';
import * as os from 'os';
import { selectVersion } from './versions';
import { winInstall } from './win-install';
import { unixInstall } from './unix-install';
export async function installXmake(version: Version): Promise<void> {
const version = await selectVersion();
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
const latest = await selectVersion('latest');
await winInstall(version, latest);
} else {
await unixInstall(version);
}
await exec('xmake --root --version');
}
+14
View File
@@ -0,0 +1,14 @@
import * as core from '@actions/core';
import { exec } from '@actions/exec';
import * as io from '@actions/io';
import * as toolCache from '@actions/tool-cache';
import * as cache from '@actions/cache';
import * as os from 'os';
import * as fs from 'fs';
import * as path from 'path';
export async function loadPackageCache(): Promise<void> {
}
export async function savePackageCache(): Promise<void> {
}