* feat(electron): add Linux AppImage releases * ci: cache Linux OpenCode CLI artifacts * fix(ci): await Linux release inventory check * fix(electron): add frameless window controls on Linux desktop Linux AppImages were created without native WM decorations and without in-app controls, leaving users unable to close the window with a mouse. Treat Linux like Windows: frameless BrowserWindow plus the existing WindowsWindowControls header buttons and app-menu entry. macOS keeps hidden title bar with traffic lights unchanged. Shared usesFramelessElectronChrome() helper drives main window, mini chat, header insets, and titlebar controls. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * feat(desktop): add configurable window controls position by OS Add desktopWindowControlsPosition setting (auto/left/right) with OS-aware defaults: Linux left, Windows right. Wire frameless chrome controls in Header, TitlebarLeftControls, and MiniChatLayout, plus a Sessions settings control for Windows and Linux desktop shells. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * fix(desktop): address Linux AppImage release review findings Propagate updater capability errors to the UI, treat missing latest-linux.yml feeds as no-update, stop installed-apps IPC spam on Linux, document FUSE/AppImage limits, add CHANGELOG entry, migrate remaining btriapitsyn URLs, and run Electron Linux unit tests on PRs. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> --------- Co-authored-by: jibanez-staticduo <staticduo@gmail.com> Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
import { spawn } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { resolveTargetArchitecture } from './target-architecture.mjs';
|
|
|
|
const env = { ...process.env };
|
|
const builderArgs = process.argv.slice(2);
|
|
const targetArchitecture = resolveTargetArchitecture({ environment: env, builderArgs });
|
|
|
|
if (process.platform === 'win32' && !env.CSC_LINK && !env.WINDOWS_CSC_LINK) {
|
|
env.CSC_IDENTITY_AUTO_DISCOVERY = 'false';
|
|
console.log('[electron] Windows code signing disabled; building unsigned installer.');
|
|
}
|
|
|
|
const bunBinaryCandidates = [
|
|
process.env.npm_execpath,
|
|
process.env.BUN_INSTALL ? path.join(process.env.BUN_INSTALL, 'bin', process.platform === 'win32' ? 'bun.exe' : 'bun') : null,
|
|
process.platform === 'win32' ? 'bun.exe' : 'bun',
|
|
].filter(Boolean);
|
|
|
|
const bunBinary = bunBinaryCandidates.find((candidate) => {
|
|
if (path.basename(candidate).toLowerCase().startsWith('bun')) {
|
|
return candidate === 'bun' || candidate === 'bun.exe' || fs.existsSync(candidate);
|
|
}
|
|
return false;
|
|
}) || (process.platform === 'win32' ? 'bun.exe' : 'bun');
|
|
|
|
if (process.platform === 'linux' && !builderArgs.some((argument) => (
|
|
argument === '--x64' || argument === '--arm64' || argument === '--arch' || argument.startsWith('--arch=')
|
|
))) {
|
|
builderArgs.push(`--${targetArchitecture.electronBuilder}`);
|
|
}
|
|
|
|
const child = spawn(bunBinary, ['x', 'electron-builder', ...builderArgs], {
|
|
env,
|
|
stdio: 'inherit',
|
|
});
|
|
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
process.exit(code ?? 1);
|
|
});
|
|
|
|
child.on('error', (error) => {
|
|
console.error('[electron] failed to start electron-builder:', error);
|
|
process.exit(1);
|
|
});
|