aboutsummaryrefslogtreecommitdiff
path: root/bundle/scripts/prepare-compiler.js
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-21 11:22:38 +0000
committer_ov4 <ov4@ov4.org>2026-10-21 11:22:38 +0000
commitfcb9e2ef516cff0b6d5168bc6465e4615d2aa96e (patch)
treeea490c33061dc0bdc56488f99a355c7626aca348 /bundle/scripts/prepare-compiler.js
parent7b94b9003daa1126ce78df37481fc52774c2f0b4 (diff)
ci(bundle): publish portable Windows and macOS desktop packages
Build and check Bundle alongside each native compiler. Publish a single Windows exe with an embedded compiler extracted into the startup directory, and a macOS tar.xz containing the app and compiler. Check Linux without publishing a desktop package and require all six nightly attachments. Include licenses in embedded assets and app resources. Verify local builds, package smoke checks and release replacement with a simulated GitHub API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bundle/scripts/prepare-compiler.js')
-rw-r--r--bundle/scripts/prepare-compiler.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundle/scripts/prepare-compiler.js b/bundle/scripts/prepare-compiler.js
index de5346a..8568ae9 100644
--- a/bundle/scripts/prepare-compiler.js
+++ b/bundle/scripts/prepare-compiler.js
@@ -1,5 +1,6 @@
import { execFileSync } from 'node:child_process';
-import { copyFileSync, mkdirSync } from 'node:fs';
+import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
+import { gzipSync } from 'node:zlib';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -7,7 +8,11 @@ const root = fileURLToPath(new URL('..', import.meta.url));
const target = execFileSync('rustc', ['--print', 'host-tuple'], { encoding: 'utf8' }).trim();
const extension = process.platform === 'win32' ? '.exe' : '';
const source = path.resolve(process.argv[2] || path.join(root, '..', 'build', `cpsc${extension}`));
-const destination = path.join(root, 'src-tauri', 'binaries', `cpsc-${target}${extension}`);
+const destination = path.join(root, 'src-tauri', 'binaries', process.platform === 'win32' ? 'cpsc.exe.gz' : `cpsc-${target}${extension}`);
mkdirSync(path.dirname(destination), { recursive: true });
-copyFileSync(source, destination);
+if (process.platform === 'win32') {
+ writeFileSync(destination, gzipSync(readFileSync(source)));
+} else {
+ copyFileSync(source, destination);
+}
console.log(`Bundled compiler: ${source}`);