mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-03 18:38:35 +02:00
feat: add cross-platform release automation
Add a GitHub Actions workflow that validates the app on pushes and pull requests, and publishes Windows, macOS, and Linux release assets when a tag is pushed. Also replace the Windows-only packaging flow with cross-platform Bun scripts for sidecar publishing and Electron packaging so the release job can package each runner natively. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import { rm } from 'node:fs/promises';
|
||||
import { dirname, join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { resolveReleaseTarget } from './releaseTarget';
|
||||
|
||||
function runCommand(command: string, args: string[], cwd: string): Promise<void> {
|
||||
return new Promise((resolvePromise, rejectPromise) => {
|
||||
const child = spawn(command, args, {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
child.on('error', rejectPromise);
|
||||
child.on('exit', (code, signal) => {
|
||||
if (code === 0) {
|
||||
resolvePromise();
|
||||
return;
|
||||
}
|
||||
|
||||
if (signal) {
|
||||
rejectPromise(new Error(`${command} exited because of signal ${signal}.`));
|
||||
return;
|
||||
}
|
||||
|
||||
rejectPromise(new Error(`${command} exited with code ${code ?? 'unknown'}.`));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const scriptDirectory = dirname(fileURLToPath(import.meta.url));
|
||||
const repositoryRoot = resolve(scriptDirectory, '..');
|
||||
const releaseTarget = resolveReleaseTarget(process.platform, process.arch);
|
||||
const sidecarProjectPath = join(
|
||||
repositoryRoot,
|
||||
'sidecar',
|
||||
'src',
|
||||
'Eryx.AgentHost',
|
||||
'Eryx.AgentHost.csproj',
|
||||
);
|
||||
const outputDirectory = join(repositoryRoot, 'dist-sidecar', releaseTarget.dotnetRuntime);
|
||||
|
||||
await rm(outputDirectory, { recursive: true, force: true });
|
||||
|
||||
await runCommand(
|
||||
'dotnet',
|
||||
[
|
||||
'publish',
|
||||
sidecarProjectPath,
|
||||
'-c',
|
||||
'Release',
|
||||
'-r',
|
||||
releaseTarget.dotnetRuntime,
|
||||
'--self-contained',
|
||||
'true',
|
||||
'-p:DebugType=None',
|
||||
'-p:DebugSymbols=false',
|
||||
'-o',
|
||||
outputDirectory,
|
||||
],
|
||||
repositoryRoot,
|
||||
);
|
||||
|
||||
console.log(`Published sidecar for ${releaseTarget.platformLabel} (${releaseTarget.dotnetRuntime}) to ${outputDirectory}`);
|
||||
Reference in New Issue
Block a user