Skip to content

Commit 53ad2c7

Browse files
linggenclaude
andcommitted
ci: add GitHub Actions workflows; drop obsolete build scripts
Two workflows: .github/workflows/ci.yml — runs on push/PR to main and memory-refactor - cargo fmt --check (enforced) - cargo clippy -D warnings (enforced) - cargo build --locked - cargo test --lib --locked .github/workflows/release.yml — runs on tag push `v*` (or manual dispatch) - Matrix builds on native runners for four targets: aarch64-apple-darwin → macos-latest (Apple Silicon runner) x86_64-apple-darwin → macos-13 (last Intel runner image) x86_64-unknown-linux-gnu → ubuntu-latest aarch64-unknown-linux-gnu → ubuntu-24.04-arm (free public runner) - Each job packages ling-mem-<target>.tar.gz + .sha256 + README + LICENSE - Artifacts uploaded, then a single publish job creates the GitHub Release with all four tarballs + combined SHA256SUMS.txt - Uses Swatinem/rust-cache (keyed per target) to reuse the LanceDB dep tree between runs. Dropped: scripts/ and Dockerfile.linux (all references `backend/` and `frontend/` which no longer exist). Local-dev builds just run `cargo build`; CI handles the release distribution now. Incidental: rustc/clippy cleanup to get -D warnings passing: - Origin now #[derive(Default)] with #[default] on Derived (was manual Default impl). - Doc list in Origin fixed to have a blank line before the standalone paragraph (clippy's doc_lazy_continuation lint). 60 tests still passing. cargo fmt + clippy + test all clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c94c552 commit 53ad2c7

15 files changed

Lines changed: 249 additions & 686 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main, memory-refactor]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
RUSTFLAGS: "-D warnings"
11+
12+
jobs:
13+
test:
14+
name: build + test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: clippy, rustfmt
22+
23+
- uses: Swatinem/rust-cache@v2
24+
with:
25+
# The LanceDB dep tree is big; cache shared across matrix jobs.
26+
shared-key: ling-mem
27+
28+
- name: cargo fmt
29+
run: cargo fmt --all -- --check
30+
31+
- name: cargo clippy
32+
# Warnings-as-errors is handled by RUSTFLAGS above; also deny clippy.
33+
run: cargo clippy --all-targets -- -D warnings
34+
35+
- name: cargo build
36+
run: cargo build --locked
37+
38+
- name: cargo test
39+
run: cargo test --lib --locked

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to build (must already exist)'
10+
required: true
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
build:
17+
name: build (${{ matrix.target }})
18+
runs-on: ${{ matrix.runner }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- target: aarch64-apple-darwin
24+
runner: macos-latest # GitHub's macOS runners are now ARM64 by default.
25+
- target: x86_64-apple-darwin
26+
runner: macos-13 # Last Intel macOS runner image.
27+
- target: x86_64-unknown-linux-gnu
28+
runner: ubuntu-latest
29+
- target: aarch64-unknown-linux-gnu
30+
runner: ubuntu-24.04-arm # Free for public repos since Jan 2025.
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event.inputs.tag || github.ref }}
35+
36+
- uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: ${{ matrix.target }}
39+
40+
- uses: Swatinem/rust-cache@v2
41+
with:
42+
key: release-${{ matrix.target }}
43+
44+
- name: build release binary
45+
run: cargo build --release --target ${{ matrix.target }} --locked --bin ling-mem
46+
47+
- name: package tarball
48+
shell: bash
49+
run: |
50+
set -euo pipefail
51+
BIN_DIR="target/${{ matrix.target }}/release"
52+
STAGING="$(mktemp -d)"
53+
cp "$BIN_DIR/ling-mem" "$STAGING/"
54+
cp README.md LICENSE "$STAGING/" || true
55+
TARBALL="ling-mem-${{ matrix.target }}.tar.gz"
56+
(cd "$STAGING" && tar czf "$GITHUB_WORKSPACE/$TARBALL" .)
57+
# sha256 checksum for the release page
58+
if command -v shasum >/dev/null; then
59+
shasum -a 256 "$TARBALL" > "$TARBALL.sha256"
60+
else
61+
sha256sum "$TARBALL" > "$TARBALL.sha256"
62+
fi
63+
ls -la "$TARBALL"*
64+
65+
- uses: actions/upload-artifact@v4
66+
with:
67+
name: ling-mem-${{ matrix.target }}
68+
path: |
69+
ling-mem-${{ matrix.target }}.tar.gz
70+
ling-mem-${{ matrix.target }}.tar.gz.sha256
71+
72+
publish:
73+
name: publish release
74+
needs: build
75+
runs-on: ubuntu-latest
76+
permissions:
77+
contents: write
78+
steps:
79+
- uses: actions/checkout@v4
80+
with:
81+
ref: ${{ github.event.inputs.tag || github.ref }}
82+
83+
- uses: actions/download-artifact@v4
84+
with:
85+
pattern: ling-mem-*
86+
path: artifacts
87+
merge-multiple: true
88+
89+
- name: compose combined checksums
90+
run: |
91+
set -euo pipefail
92+
cd artifacts
93+
cat *.sha256 > SHA256SUMS.txt
94+
ls -la
95+
96+
- name: publish GitHub release
97+
uses: softprops/action-gh-release@v2
98+
with:
99+
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
100+
draft: false
101+
generate_release_notes: true
102+
files: |
103+
artifacts/*.tar.gz
104+
artifacts/SHA256SUMS.txt

scripts/Dockerfile.linux

Lines changed: 0 additions & 92 deletions
This file was deleted.

scripts/build-linux.sh

Lines changed: 0 additions & 64 deletions
This file was deleted.

scripts/build-mac.sh

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)