Skip to content

Commit 1a4ea0c

Browse files
committed
ci: build native Windows bridge target
1 parent 4780ec1 commit 1a4ea0c

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ jobs:
3131
run: bun run typecheck
3232

3333
- name: Build bridge binaries
34+
if: runner.os != 'Windows'
3435
run: bun run build
3536

37+
- name: Build Windows bridge binary
38+
if: runner.os == 'Windows'
39+
run: bun run build:bridge
40+
env:
41+
BUILD_TARGETS: bun-windows-x64
42+
3643
- name: Run tests
3744
run: bun test

bridge/build.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
#!/usr/bin/env bun
22
import { $ } from "bun";
33

4-
const targets = [
4+
const allTargets = [
55
"bun-linux-x64",
66
"bun-linux-arm64",
77
"bun-darwin-x64",
88
"bun-darwin-arm64",
99
"bun-windows-x64",
1010
];
1111

12+
const requestedTargets = process.env.BUILD_TARGETS?.split(",")
13+
.map((target) => target.trim())
14+
.filter(Boolean);
15+
16+
const targets = requestedTargets?.length ? requestedTargets : allTargets;
17+
18+
for (const target of targets) {
19+
if (!allTargets.includes(target)) {
20+
throw new Error(`Unknown bridge build target: ${target}`);
21+
}
22+
}
23+
1224
const outDir = "./public/bin";
1325

1426
await $`mkdir -p ${outDir}`;

0 commit comments

Comments
 (0)