Prepare Linux builds and validate native desktop runtime
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { packager } from '@electron/packager';
|
||||
const options = Object.fromEntries(process.argv.slice(2).map(arg => {
|
||||
const match = /^--(platform|arch)=(win32|linux|x64|arm64)$/.exec(arg);
|
||||
if (!match) throw new Error('Use --platform=win32|linux and --arch=x64|arm64.');
|
||||
return [match[1], match[2]];
|
||||
}));
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { packageTarget } from './package-target.mjs';
|
||||
const project = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const target = packageTarget(process.argv.slice(2));
|
||||
const outputs = await packager({
|
||||
dir: '.', name: 'RuneStone-Browser', out: 'dist', overwrite: true,
|
||||
platform: options.platform || process.platform, arch: options.arch || process.arch,
|
||||
dir: project, name: 'RuneStone-Browser', out: resolve(project, 'dist'), overwrite: true,
|
||||
...target,
|
||||
ignore: [/^\/(test|scripts|output|plugin|releases|\.github)(\/|$)/, /^\/src\/(ui\/|host\.mjs|main\.mjs|preload\.cjs)/],
|
||||
});
|
||||
for (const output of outputs) console.log(output);
|
||||
|
||||
Reference in New Issue
Block a user