- Add SQLite amalgamation fetch script (make build-sqlite) - Embed SQLite in release builds, link system lib in dev - Create sqlite_embedded.zig utility module - Unify experiment/run/log commands with auto mode detection - Add Forgejo CI workflow for building with embedded SQLite - Update READMEs for local mode and build instructions SQLite follows rsync embedding pattern: assets/sqlite_release_<os>_<arch>/ Zero external dependencies for release builds.
80 lines
1.7 KiB
YAML
80 lines
1.7 KiB
YAML
name: Build CLI with Embedded SQLite
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'cli/**'
|
|
- '.forgejo/workflows/build-cli.yml'
|
|
pull_request:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'cli/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-linux
|
|
- aarch64-linux
|
|
include:
|
|
- target: x86_64-linux
|
|
arch: x86_64
|
|
- target: aarch64-linux
|
|
arch: arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Zig
|
|
uses: goto-bus-stop/setup-zig@v2
|
|
with:
|
|
version: 0.15.0
|
|
|
|
- name: Fetch SQLite Amalgamation
|
|
run: |
|
|
cd cli
|
|
make build-sqlite SQLITE_VERSION=3450000
|
|
|
|
- name: Build Release Binary
|
|
run: |
|
|
cd cli
|
|
zig build prod -Dtarget=${{ matrix.target }}
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ml-cli-${{ matrix.target }}
|
|
path: cli/zig-out/bin/ml
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [x86_64, arm64]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Zig
|
|
uses: goto-bus-stop/setup-zig@v2
|
|
with:
|
|
version: 0.15.0
|
|
|
|
- name: Fetch SQLite Amalgamation
|
|
run: |
|
|
cd cli
|
|
make build-sqlite SQLITE_VERSION=3450000
|
|
|
|
- name: Build Release Binary
|
|
run: |
|
|
cd cli
|
|
zig build prod -Dtarget=${{ matrix.arch }}-macos
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ml-cli-${{ matrix.arch }}-macos
|
|
path: cli/zig-out/bin/ml
|