Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(ci): make the Windows/Linux desktop build actually package (#2897)

mike-inkeep37ffe8fbc93c
diff --git a/.github/workflows/desktop-build-win-linux.yml b/.github/workflows/desktop-build-win-linux.yml
index 864f8dd8b..2d6557aec 100644
--- a/.github/workflows/desktop-build-win-linux.yml
+++ b/.github/workflows/desktop-build-win-linux.yml
@@ -122,15 +122,27 @@ jobs:
pnpm exec turbo run build --filter=@inkeep/open-knowledge
# Hand the platform-neutral build products to the packaging jobs:
- # the full bundled CLI tree + the native-config addon dir the
- # electron-builder `../native-config` extraResources rule reads
+ # the full bundled CLI tree + core/server dist + the native-config addon
+ # dir the electron-builder `../native-config` extraResources rule reads
# (index.js loader + package.json + every staged .node).
+ #
+ # core/server dist are load-bearing: `build:desktop` (electron-vite) in
+ # the packaging jobs bundles the desktop main process + app renderer
+ # source, which import `@inkeep/open-knowledge-core` and
+ # `@inkeep/open-knowledge-server`. Those resolve via `exports` to
+ # `./dist/index.mjs`; without the built dist here, electron-vite fails
+ # with "Rolldown failed to resolve import @inkeep/open-knowledge-core".
+ # The packaging jobs can't rebuild them (the Windows job's default shell
+ # can't run the CLI build chain's `cp -r` bash-isms), so prepare builds
+ # everything once and ships the dist forward.
- name: Upload workspace bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: workspace-bundle
path: |
packages/cli/dist/
+ packages/core/dist/
+ packages/server/dist/
packages/native-config/index.js
packages/native-config/index.d.ts
packages/native-config/*.node
diff --git a/packages/desktop/scripts/prepare-platform-natives.mjs b/packages/desktop/scripts/prepare-platform-natives.mjs
index fec2016de..75336a94c 100644
--- a/packages/desktop/scripts/prepare-platform-natives.mjs
+++ b/packages/desktop/scripts/prepare-platform-natives.mjs
@@ -128,9 +128,17 @@ for (const suffix of suffixes) {
}
mkdirSync(targetDir, { recursive: true });
- // bsdtar ships with Windows 10+ (and every Linux runner), so plain `tar`
- // works on both platforms this script supports.
- execFileSync('tar', ['-xzf', tmpTarball, '-C', targetDir, '--strip-components=1'], {
+ // Extract with bsdtar. On Windows a bare `tar` resolved from a Git-bash
+ // PATH is GNU tar, which misreads the absolute `C:\...` tarball path as an
+ // rsync-style `host:path` remote and dies with "Cannot connect to C:".
+ // Windows 10+ ships bsdtar at System32\tar.exe, which handles drive-letter
+ // paths natively — invoke it by absolute path rather than trusting PATH
+ // resolution. Linux runners keep plain `tar`.
+ const tarBin =
+ process.platform === 'win32'
+ ? join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'tar.exe')
+ : 'tar';
+ execFileSync(tarBin, ['-xzf', tmpTarball, '-C', targetDir, '--strip-components=1'], {
stdio: 'inherit',
});
} finally {