Files

36 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

2026-04-29 19:48:14 +00:00
const targets = [
{ target: 'x86_64-unknown-linux-gnu', name: 'uptimerunner-linux-x64' },
{ target: 'aarch64-unknown-linux-gnu', name: 'uptimerunner-linux-arm64' },
{ target: 'x86_64-apple-darwin', name: 'uptimerunner-macos-x64' },
{ target: 'aarch64-apple-darwin', name: 'uptimerunner-macos-arm64' },
{ target: 'x86_64-pc-windows-msvc', name: 'uptimerunner-windows-x64.exe' },
];
await Deno.mkdir('dist/binaries', { recursive: true });
for (const target of targets) {
console.log(`Compiling ${target.name}...`);
const command = new Deno.Command('deno', {
args: [
'compile',
'--allow-net',
'--allow-read',
'--allow-write',
'--allow-run',
'--allow-env',
'--allow-sys',
'--target',
target.target,
'--output',
`dist/binaries/${target.name}`,
'mod.ts',
],
stdout: 'inherit',
stderr: 'inherit',
});
const output = await command.output();
if (!output.success) {
throw new Error(`Failed to compile ${target.name}`);
}
}