Skip to content

Commit 9894eff

Browse files
committed
Merge pull request #32 from OpenKnots/okcode/windows-port-v2
feat(desktop): add initial Windows port thanks @Jonohobs
2 parents 7443631 + 2081022 commit 9894eff

7 files changed

Lines changed: 53 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,50 @@ jobs:
7373
test -f apps/desktop/dist-electron/preload.js
7474
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.js
7575
76+
desktop_windows:
77+
name: Windows Desktop Build
78+
runs-on: windows-2022
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v6
82+
83+
- name: Setup Bun
84+
uses: oven-sh/setup-bun@v2
85+
with:
86+
bun-version-file: package.json
87+
88+
- name: Setup Node
89+
uses: actions/setup-node@v6
90+
with:
91+
node-version-file: package.json
92+
93+
- name: Cache Bun, Turbo, and electron-builder
94+
uses: actions/cache@v5
95+
with:
96+
path: |
97+
~/.bun/install/cache
98+
~\AppData\Local\electron-builder\Cache
99+
.turbo
100+
key: ${{ runner.os }}-desktop-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
101+
restore-keys: |
102+
${{ runner.os }}-desktop-${{ hashFiles('bun.lock') }}-
103+
104+
- name: Install dependencies
105+
run: bun install --frozen-lockfile
106+
107+
- name: Build Windows desktop artifact
108+
run: bun run dist:desktop:artifact -- --platform win --target nsis --arch x64 --verbose
109+
110+
- name: Upload Windows desktop artifact
111+
uses: actions/upload-artifact@v7
112+
with:
113+
name: desktop-windows-x64
114+
path: |
115+
release/*.exe
116+
release/*.exe.blockmap
117+
release/builder-debug.yml
118+
if-no-files-found: error
119+
76120
release_smoke:
77121
name: Release Smoke
78122
runs-on: ubuntu-24.04

apps/marketing/public/favicon.ico

3.26 KB
Binary file not shown.
3.26 KB
Binary file not shown.

assets/dev/okcode-dev-windows.ico

32.4 KB
Binary file not shown.

assets/prod/okcode-web-favicon.ico

3.26 KB
Binary file not shown.

scripts/build-desktop-artifact.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,14 @@ const createBuildConfig = Effect.fn("createBuildConfig")(function* (
552552
};
553553
if (signed) {
554554
winConfig.azureSignOptions = yield* AzureTrustedSigningOptionsConfig;
555+
} else {
556+
// Production dependencies are installed into the staged app ahead of packaging.
557+
// Skip electron-builder's extra native rebuild step so Windows builds can use
558+
// shipped prebuilds like node-pty instead of requiring local Spectre libs.
559+
buildConfig.npmRebuild = false;
560+
// Unsigned local builds shouldn't need the Windows code-signing toolchain or
561+
// rcedit metadata pass; skipping it avoids symlink-privileged cache extraction.
562+
winConfig.signAndEditExecutable = false;
555563
}
556564
buildConfig.win = winConfig;
557565
}

scripts/generate-brand-assets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ def resize(img: Image.Image, size: int) -> Image.Image:
2828

2929

3030
def save_ico(path: Path, source: Image.Image, sizes: tuple[int, ...]) -> None:
31-
images = [resize(source, s) for s in sizes]
3231
path.parent.mkdir(parents=True, exist_ok=True)
33-
images[0].save(
32+
source.save(
3433
path,
3534
format="ICO",
3635
sizes=[(s, s) for s in sizes],
37-
append_images=images[1:],
3836
)
3937

4038

0 commit comments

Comments
 (0)