This commit is contained in:
Ivan Fontosh
2026-05-17 23:20:37 +08:00
parent 394b42e845
commit 963a1f0790
4 changed files with 45 additions and 1 deletions
+2
View File
@@ -19,6 +19,7 @@ void test('package.json: конфиг electron-builder (mac/win/linux)', () => {
nsis?: { artifactName?: string };
dmg?: { artifactName?: string };
files: string[];
toolsets?: { appimage?: string };
};
};
assert.ok(pkg.build);
@@ -38,6 +39,7 @@ void test('package.json: конфиг electron-builder (mac/win/linux)', () => {
),
);
assert.ok(Array.isArray(pkg.build.mac.target));
assert.equal(pkg.build.toolsets?.appimage, '1.0.2');
assert.ok(Array.isArray(pkg.build.linux.target));
const linuxTargets = pkg.build.linux.target as { target: string; arch: string[] }[];
assert.ok(linuxTargets.some((t) => t.target === 'AppImage'));
+2
View File
@@ -38,6 +38,8 @@ npm run release:info # версия и пример тега vX.Y.Z (тег о
| `npm run pack:linux` | Linux или WSL с зависимостями | `release/` — AppImage x64/arm64 + `latest-linux.yml` |
| `npm run pack:mac` | macOS | `release/` — dmg + `latest-mac.yml` |
Linux AppImage не собирается напрямую из Windows PowerShell: `mksquashfs` — Linux-инструмент. На Windows запускайте команду внутри WSL.
Скопируйте нужные файлы из `release/` в папку публикации (например `D:\TTRPG-Release\`).
## Сервер обновлений
+4 -1
View File
@@ -19,7 +19,7 @@
"pack:dir": "npm run build && node scripts/release-win-prep.mjs && electron-builder --dir",
"pack:mac": "npm run build && electron-builder --mac",
"pack:win": "npm run build && node scripts/release-win-prep.mjs && electron-builder --win",
"pack:linux": "npm run build && electron-builder --linux"
"pack:linux": "node scripts/release-linux-pack.mjs"
},
"keywords": [],
"author": "",
@@ -96,6 +96,9 @@
"node_modules/@img/**",
"node_modules/ffmpeg-static/**"
],
"toolsets": {
"appimage": "1.0.2"
},
"mac": {
"category": "public.app-category.games",
"target": [
+37
View File
@@ -0,0 +1,37 @@
/**
* Build Linux release artifacts.
*
* AppImage packaging uses Linux tooling (mksquashfs). Running it from
* Windows PowerShell reaches linux-unpacked, then fails while creating
* the AppImage. Build from Linux/WSL instead.
*/
import { spawnSync } from 'node:child_process';
import process from 'node:process';
function run(command, args) {
const result = spawnSync(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
});
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
if (process.platform === 'win32') {
console.error(
[
'[pack:linux] AppImage нельзя собрать напрямую из Windows PowerShell.',
'Запустите команду внутри Linux/WSL из папки проекта:',
'',
' cd /mnt/d/Work/my_projects/dnd_project/dnd_player',
' npm ci',
' npm run pack:linux',
].join('\n'),
);
process.exit(1);
}
run('npm', ['run', 'build']);
run('electron-builder', ['--linux']);