Skip to content

Commit bb55393

Browse files
committed
ci: build & release the lumen CLI on Linux and Windows
The lumen CLI and the core/daemon/mcp crates are pure cross-platform Rust; only the Tauri GUI is macOS-specific. Enable rusqlite `bundled` so SQLite compiles from source on every OS (no system libsqlite3), then: - CI: replace the Linux-only test job with an ubuntu+windows matrix that builds the CLI and runs the core/daemon/mcp tests on both. - Release: add a build-cli matrix job that builds the CLI for x86_64-unknown-linux-gnu and x86_64-pc-windows-msvc and attaches a tar.gz / zip to the release. The GUI .dmg stays macOS-only.
1 parent 1a7e0ed commit bb55393

4 files changed

Lines changed: 94 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,17 @@ jobs:
6565
working-directory: lumenator
6666
run: pnpm build
6767

68-
# ── Linux job: portable Rust-core tests (no macOS SDK required) ────────────
69-
test-linux:
70-
name: Test (ubuntu-latest)
71-
runs-on: ubuntu-latest
68+
# ── Cross-platform CLI/core job: Linux + Windows ───────────────────────────
69+
# The `lumen` CLI and the core/daemon/mcp crates are pure cross-platform Rust.
70+
# SQLite is compiled from source (rusqlite `bundled`), so no system libsqlite3
71+
# is needed on any OS. The Tauri GUI is macOS-only and lives in the check job.
72+
test:
73+
name: Test (${{ matrix.os }})
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os: [ubuntu-latest, windows-latest]
78+
runs-on: ${{ matrix.os }}
7279

7380
steps:
7481
- uses: actions/checkout@v4
@@ -80,11 +87,8 @@ jobs:
8087
workspaces: ". -> target"
8188
cache-on-failure: true
8289

83-
- name: Install system libraries
84-
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev pkg-config build-essential
90+
- name: Build CLI (proves cross-platform compile)
91+
run: cargo build -p lumen-cli --release
8592

86-
- name: cargo test (lumen-core)
87-
run: cargo test -p lumen-core
88-
89-
- name: cargo test (lumen-daemon)
90-
run: cargo test -p lumen-daemon
93+
- name: cargo test (core + daemon + mcp)
94+
run: cargo test -p lumen-core -p lumen-daemon -p lumen-mcp

.github/workflows/release.yml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,80 @@ jobs:
174174
$NOTES_OPT
175175
176176
# ════════════════════════════════════════════════════════════════════════════
177-
# Job 2: Update the Homebrew tap (runs after build succeeds)
177+
# Job 2: Cross-platform CLI artifacts (Linux + Windows)
178+
# ────────────────────────────────────────────────────────────────────────────
179+
# The GUI (.dmg) is macOS-only, but the `lumen` CLI is pure cross-platform Rust
180+
# (SQLite compiled from source via rusqlite `bundled` — no system lib needed).
181+
# These jobs build the CLI per target and attach it to the release the macOS
182+
# build job created, so each platform gets a native `lumen` binary.
183+
# ════════════════════════════════════════════════════════════════════════════
184+
build-cli:
185+
name: Build CLI (${{ matrix.name }})
186+
needs: build # the GitHub Release must exist before we upload to it
187+
188+
permissions:
189+
contents: write # required to upload assets to the release
190+
191+
strategy:
192+
fail-fast: false
193+
matrix:
194+
include:
195+
- name: linux-x86_64
196+
os: ubuntu-latest
197+
target: x86_64-unknown-linux-gnu
198+
- name: windows-x86_64
199+
os: windows-latest
200+
target: x86_64-pc-windows-msvc
201+
202+
runs-on: ${{ matrix.os }}
203+
204+
steps:
205+
- uses: actions/checkout@v4
206+
207+
- uses: dtolnay/rust-toolchain@stable
208+
with:
209+
targets: ${{ matrix.target }}
210+
211+
- uses: swatinem/rust-cache@v2
212+
with:
213+
workspaces: ". -> target"
214+
cache-on-failure: true
215+
216+
- name: Build CLI
217+
run: cargo build -p lumen-cli --release --target ${{ matrix.target }}
218+
219+
# Package as .tar.gz on Unix; upload to the release with --clobber so
220+
# re-runs replace rather than fail on an existing asset.
221+
- name: Package + upload (Unix)
222+
if: runner.os != 'Windows'
223+
env:
224+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225+
run: |
226+
VERSION="${GITHUB_REF_NAME#v}"
227+
TAG="${GITHUB_REF_NAME}"
228+
ASSET="lumen-v${VERSION}-${{ matrix.target }}.tar.gz"
229+
mkdir -p dist
230+
cp "target/${{ matrix.target }}/release/lumen" dist/lumen
231+
tar -czf "dist/${ASSET}" -C dist lumen
232+
gh release upload "$TAG" "dist/${ASSET}" --clobber
233+
234+
# Package as .zip on Windows (lumen.exe).
235+
- name: Package + upload (Windows)
236+
if: runner.os == 'Windows'
237+
shell: pwsh
238+
env:
239+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
240+
run: |
241+
$version = "${env:GITHUB_REF_NAME}" -replace '^v',''
242+
$tag = "${env:GITHUB_REF_NAME}"
243+
$asset = "lumen-v$version-${{ matrix.target }}.zip"
244+
New-Item -ItemType Directory -Force -Path dist | Out-Null
245+
Copy-Item "target/${{ matrix.target }}/release/lumen.exe" "dist/lumen.exe"
246+
Compress-Archive -Path "dist/lumen.exe" -DestinationPath "dist/$asset" -Force
247+
gh release upload "$tag" "dist/$asset" --clobber
248+
249+
# ════════════════════════════════════════════════════════════════════════════
250+
# Job 3: Update the Homebrew tap (runs after build succeeds)
178251
# ════════════════════════════════════════════════════════════════════════════
179252
update-tap:
180253
name: Update Homebrew tap

crates/lumen-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ crossterm = "0.28"
1414
clap = { version = "4", features = ["derive"] }
1515
serde = { version = "1", features = ["derive"] }
1616
serde_json = "1"
17-
rusqlite = "0.31"
17+
rusqlite = { version = "0.31", features = ["bundled"] }
1818
tungstenite = "0.24"
1919
dirs = "5"

crates/lumen-core/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ edition = "2024"
77
serde = { version = "1", features = ["derive"] }
88
serde_json = "1"
99
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }
10-
rusqlite = "0.31"
10+
# `bundled` compiles SQLite from source via libsqlite3-sys — no system libsqlite3
11+
# needed on any OS. Feature unifies with sqlx-sqlite (shared libsqlite3-sys 0.28),
12+
# so the whole workspace builds on macOS, Linux, and Windows without a system lib.
13+
rusqlite = { version = "0.31", features = ["bundled"] }
1114
tiktoken-rs = "0.6"
1215
once_cell = "1"
1316
tree-sitter = "0.26.9"

0 commit comments

Comments
 (0)