mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix
This commit is contained in:
parent
fb42729dec
commit
dc34c4d00c
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target_platform: [linux,darwin]
|
||||
target_platform: [linux]
|
||||
target_arch: [x64, arm64]
|
||||
steps:
|
||||
- name: Clone Main Repository
|
||||
@ -53,6 +53,8 @@ jobs:
|
||||
|
||||
- name: Build NuCat Linux
|
||||
run: |
|
||||
export NAPCAT_BUILDSYS=${{ matrix.target_platform }}
|
||||
export NAPCAT_BUILDARCH=${{ matrix.target_arch }}
|
||||
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
||||
npm run build:prod
|
||||
cd dist
|
||||
@ -87,6 +89,8 @@ jobs:
|
||||
|
||||
- name: Build NuCat Linux
|
||||
run: |
|
||||
export NAPCAT_BUILDSYS=${{ matrix.target_platform }}
|
||||
export NAPCAT_BUILDARCH=${{ matrix.target_arch }}
|
||||
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
||||
npm run build:prod
|
||||
cd dist
|
||||
|
@ -20,55 +20,42 @@ const nodeModules = [...builtinModules, builtinModules.map(m => `node:${m}`)].fl
|
||||
function genCpModule(module: string) {
|
||||
return { src: `./node_modules/${module}`, dest: `dist/node_modules/${module}`, flatten: false };
|
||||
}
|
||||
const systemPlatform = os.platform();
|
||||
let startScripts: string[] | undefined = undefined;
|
||||
let baseConfigPlugin: PluginOption[] | undefined = undefined;
|
||||
if (systemPlatform == "linux") {
|
||||
let MoeHooModule: any = [];
|
||||
if (process.env.NAPCAT_BUILDSYS == "linux") {
|
||||
if (process.env.NAPCAT_BUILDARCH == "x64") {
|
||||
MoeHooModule = [{ src: './src/core.lib/MoeHoo-linux-x64.node', dest: 'dist' }];
|
||||
}
|
||||
startScripts = ['./script/napcat.sh'];
|
||||
baseConfigPlugin = [
|
||||
// PreprocessorDirectives(),
|
||||
cp({
|
||||
targets: [
|
||||
// ...external.map(genCpModule),
|
||||
{ src: './src/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './src/onebot11/onebot11.json', dest: 'dist/config/' },
|
||||
{ src: './package.json', dest: 'dist' },
|
||||
{ src: './README.md', dest: 'dist' },
|
||||
{ src: './logo.png', dest: 'dist/logs' },
|
||||
{ src: './src/core.lib/MoeHoo-linux-x64.node', dest: 'dist' },
|
||||
...(startScripts.map((startScript) => {
|
||||
return { src: startScript, dest: 'dist' };
|
||||
})),
|
||||
]
|
||||
}),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
];
|
||||
} else {
|
||||
} else if (process.env.NAPCAT_BUILDSYS == "win32") {
|
||||
if (process.env.NAPCAT_BUILDARCH == "x64") {
|
||||
MoeHooModule = [{ src: './src/core.lib/MoeHoo-win32-x64.node', dest: 'dist' }];
|
||||
}
|
||||
startScripts = ['./script/napcat.ps1', './script/napcat.bat', './script/napcat-utf8.bat', './script/napcat-utf8.ps1', './script/napcat-log.ps1'];
|
||||
baseConfigPlugin = [
|
||||
// PreprocessorDirectives(),
|
||||
cp({
|
||||
targets: [
|
||||
// ...external.map(genCpModule),
|
||||
{ src: './src/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './src/onebot11/onebot11.json', dest: 'dist/config/' },
|
||||
{ src: './package.json', dest: 'dist' },
|
||||
{ src: './README.md', dest: 'dist' },
|
||||
{ src: './logo.png', dest: 'dist/logs' },
|
||||
{ src: './src/core.lib/MoeHoo-win32-x64.node', dest: 'dist' },
|
||||
...(startScripts.map((startScript) => {
|
||||
return { src: startScript, dest: 'dist' };
|
||||
})),
|
||||
]
|
||||
}),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
];
|
||||
|
||||
} else {
|
||||
MoeHooModule = [{ src: './src/core.lib/MoeHoo-win32-x64.node', dest: 'dist' }, { src: './src/core.lib/MoeHoo-linux-x64.node', dest: 'dist' }];
|
||||
startScripts = ['./script/napcat.sh', './script/napcat.ps1', './script/napcat.bat', './script/napcat-utf8.bat', './script/napcat-utf8.ps1', './script/napcat-log.ps1'];
|
||||
}
|
||||
|
||||
|
||||
let baseConfigPlugin: PluginOption[] = [
|
||||
// PreprocessorDirectives(),
|
||||
cp({
|
||||
targets: [
|
||||
// ...external.map(genCpModule),
|
||||
{ src: './src/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './src/onebot11/onebot11.json', dest: 'dist/config/' },
|
||||
{ src: './package.json', dest: 'dist' },
|
||||
{ src: './README.md', dest: 'dist' },
|
||||
{ src: './logo.png', dest: 'dist/logs' },
|
||||
...MoeHooModule,
|
||||
...(startScripts.map((startScript) => {
|
||||
return { src: startScript, dest: 'dist' };
|
||||
})),
|
||||
]
|
||||
}),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
];
|
||||
// if (os.platform() !== 'win32') {
|
||||
// startScripts = ['./script/napcat.sh'];
|
||||
// }
|
||||
|
Loading…
x
Reference in New Issue
Block a user