fetch_ml/.forgejo/workflows/build-cli.yml
Jeremie Fraeys e3dad32029
ci: consolidate CLI build workflow and add static rsync
- Add musl-tools to build-cli.yml for static linking support
- Move rsync build from ci.yml into build-cli.yml workflow
- Fix SQLite year parameter in both workflows
- Remove redundant RSYNC_VERSION env var from ci.yml

This consolidates the CLI artifact build process into a single
workflow file, making the CI pipeline easier to maintain.
2026-03-05 13:12:45 -05:00

90 lines
2 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.2
- name: Install musl-tools (for static rsync build)
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Fetch SQLite Amalgamation
run: |
cd cli
make build-sqlite SQLITE_VERSION=3480000 SQLITE_YEAR=2025
- name: Build static rsync
run: |
cd cli
make build-rsync RSYNC_VERSION=3.3.0
- 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.2
- name: Fetch SQLite Amalgamation
run: |
cd cli
make build-sqlite SQLITE_VERSION=3480000 SQLITE_YEAR=2025
- 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