Skip to content

Commit 81dcd57

Browse files
committed
Add CI/CD workflows for cross-platform binary releases
- Add release.yml: builds for 9 targets (macOS, Linux, Windows, ARM variants) - Add ci.yml: test/lint/format on push to main - Update README with binary installation instructions - Remove broken indra-mcp link (future npm package)
1 parent 9707145 commit 81dcd57

3 files changed

Lines changed: 329 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Cache cargo registry
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cargo/registry
30+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
31+
32+
- name: Cache cargo index
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cargo/git
36+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
37+
38+
- name: Cache target directory
39+
uses: actions/cache@v4
40+
with:
41+
path: target
42+
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
43+
44+
- name: Run tests
45+
run: cargo test --all-features
46+
47+
- name: Run clippy
48+
run: cargo clippy -- -D warnings
49+
50+
- name: Check formatting
51+
run: cargo fmt --all -- --check
52+
53+
build:
54+
name: Build
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install Rust toolchain
60+
uses: dtolnay/rust-toolchain@stable
61+
62+
- name: Build
63+
run: cargo build --release --locked

.github/workflows/release.yml

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
name: Release Binaries
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to release (e.g., v0.1.1)'
11+
required: false
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
RUST_BACKTRACE: 1
16+
17+
jobs:
18+
build:
19+
name: Build ${{ matrix.target }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
# macOS Intel
26+
- target: x86_64-apple-darwin
27+
os: macos-latest
28+
binary_name: indra
29+
archive_name: indra-x86_64-apple-darwin.tar.gz
30+
31+
# macOS Apple Silicon
32+
- target: aarch64-apple-darwin
33+
os: macos-latest
34+
binary_name: indra
35+
archive_name: indra-aarch64-apple-darwin.tar.gz
36+
37+
# Linux x86_64 (glibc)
38+
- target: x86_64-unknown-linux-gnu
39+
os: ubuntu-latest
40+
binary_name: indra
41+
archive_name: indra-x86_64-unknown-linux-gnu.tar.gz
42+
43+
# Linux x86_64 (musl - static)
44+
- target: x86_64-unknown-linux-musl
45+
os: ubuntu-latest
46+
binary_name: indra
47+
archive_name: indra-x86_64-unknown-linux-musl.tar.gz
48+
49+
# Linux ARM64
50+
- target: aarch64-unknown-linux-gnu
51+
os: ubuntu-latest
52+
binary_name: indra
53+
archive_name: indra-aarch64-unknown-linux-gnu.tar.gz
54+
55+
# Linux ARM64 (musl)
56+
- target: aarch64-unknown-linux-musl
57+
os: ubuntu-latest
58+
binary_name: indra
59+
archive_name: indra-aarch64-unknown-linux-musl.tar.gz
60+
61+
# Raspberry Pi (ARMv7)
62+
- target: armv7-unknown-linux-gnueabihf
63+
os: ubuntu-latest
64+
binary_name: indra
65+
archive_name: indra-armv7-unknown-linux-gnueabihf.tar.gz
66+
67+
# Windows x86_64
68+
- target: x86_64-pc-windows-msvc
69+
os: windows-latest
70+
binary_name: indra.exe
71+
archive_name: indra-x86_64-pc-windows-msvc.zip
72+
73+
# Windows ARM64
74+
- target: aarch64-pc-windows-msvc
75+
os: windows-latest
76+
binary_name: indra.exe
77+
archive_name: indra-aarch64-pc-windows-msvc.zip
78+
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v4
82+
83+
- name: Install Rust toolchain
84+
uses: dtolnay/rust-toolchain@stable
85+
with:
86+
targets: ${{ matrix.target }}
87+
88+
- name: Cache cargo registry
89+
uses: actions/cache@v4
90+
with:
91+
path: ~/.cargo/registry
92+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
93+
94+
- name: Cache cargo index
95+
uses: actions/cache@v4
96+
with:
97+
path: ~/.cargo/git
98+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
99+
100+
- name: Cache target directory
101+
uses: actions/cache@v4
102+
with:
103+
path: target
104+
key: ${{ runner.os }}-${{ matrix.target }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
105+
106+
- name: Install cross-compilation tools (Linux ARM)
107+
if: runner.os == 'Linux' && contains(matrix.target, 'aarch64')
108+
run: |
109+
sudo apt-get update
110+
sudo apt-get install -y gcc-aarch64-linux-gnu
111+
112+
- name: Install cross-compilation tools (Linux ARMv7)
113+
if: runner.os == 'Linux' && contains(matrix.target, 'armv7')
114+
run: |
115+
sudo apt-get update
116+
sudo apt-get install -y gcc-arm-linux-gnueabihf
117+
118+
- name: Install musl tools
119+
if: contains(matrix.target, 'musl')
120+
run: |
121+
sudo apt-get update
122+
sudo apt-get install -y musl-tools
123+
124+
- name: Build binary
125+
run: cargo build --release --locked --target ${{ matrix.target }}
126+
127+
- name: Strip binary (Unix)
128+
if: runner.os != 'Windows'
129+
run: |
130+
strip target/${{ matrix.target }}/release/${{ matrix.binary_name }} || true
131+
132+
- name: Create archive (Unix)
133+
if: runner.os != 'Windows'
134+
run: |
135+
cd target/${{ matrix.target }}/release
136+
tar czf ../../../${{ matrix.archive_name }} ${{ matrix.binary_name }}
137+
cd ../../..
138+
ls -lh ${{ matrix.archive_name }}
139+
140+
- name: Create archive (Windows)
141+
if: runner.os == 'Windows'
142+
shell: pwsh
143+
run: |
144+
cd target/${{ matrix.target }}/release
145+
Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.archive_name }}
146+
cd ../../..
147+
dir ${{ matrix.archive_name }}
148+
149+
- name: Generate checksum
150+
shell: bash
151+
run: |
152+
if [ "${{ runner.os }}" = "Windows" ]; then
153+
certutil -hashfile ${{ matrix.archive_name }} SHA256 | grep -v "SHA256" | grep -v "CertUtil" > ${{ matrix.archive_name }}.sha256
154+
else
155+
shasum -a 256 ${{ matrix.archive_name }} > ${{ matrix.archive_name }}.sha256
156+
fi
157+
cat ${{ matrix.archive_name }}.sha256
158+
159+
- name: Upload artifacts
160+
uses: actions/upload-artifact@v4
161+
with:
162+
name: ${{ matrix.target }}
163+
path: |
164+
${{ matrix.archive_name }}
165+
${{ matrix.archive_name }}.sha256
166+
167+
release:
168+
name: Create Release
169+
needs: build
170+
runs-on: ubuntu-latest
171+
permissions:
172+
contents: write
173+
steps:
174+
- name: Checkout code
175+
uses: actions/checkout@v4
176+
177+
- name: Download all artifacts
178+
uses: actions/download-artifact@v4
179+
with:
180+
path: artifacts
181+
182+
- name: Prepare release assets
183+
run: |
184+
mkdir release-assets
185+
find artifacts -type f -exec cp {} release-assets/ \;
186+
ls -lh release-assets/
187+
188+
- name: Extract version from tag
189+
id: get_version
190+
run: |
191+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.tag }}" ]; then
192+
echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
193+
else
194+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
195+
fi
196+
197+
- name: Create Release
198+
uses: softprops/action-gh-release@v2
199+
with:
200+
tag_name: ${{ steps.get_version.outputs.version }}
201+
name: Release ${{ steps.get_version.outputs.version }}
202+
draft: false
203+
prerelease: false
204+
files: release-assets/*
205+
body: |
206+
## indra_db ${{ steps.get_version.outputs.version }}
207+
208+
### Installation
209+
210+
**Via cargo:**
211+
```bash
212+
cargo install indra_db
213+
```
214+
215+
**Via prebuilt binary:**
216+
Download the appropriate binary for your platform below, extract it, and add to your PATH.
217+
218+
### Binaries
219+
220+
- **macOS Intel**: `indra-x86_64-apple-darwin.tar.gz`
221+
- **macOS Apple Silicon**: `indra-aarch64-apple-darwin.tar.gz`
222+
- **Linux x86_64 (glibc)**: `indra-x86_64-unknown-linux-gnu.tar.gz`
223+
- **Linux x86_64 (musl/static)**: `indra-x86_64-unknown-linux-musl.tar.gz`
224+
- **Linux ARM64**: `indra-aarch64-unknown-linux-gnu.tar.gz`
225+
- **Linux ARM64 (musl)**: `indra-aarch64-unknown-linux-musl.tar.gz`
226+
- **Raspberry Pi (ARMv7)**: `indra-armv7-unknown-linux-gnueabihf.tar.gz`
227+
- **Windows x86_64**: `indra-x86_64-pc-windows-msvc.zip`
228+
- **Windows ARM64**: `indra-aarch64-pc-windows-msvc.zip`
229+
230+
SHA256 checksums are provided for verification.
231+
232+
### Usage
233+
234+
```bash
235+
indra --help
236+
```
237+
238+
See [README](https://github.com/moonstripe/indra_db#readme) for full documentation.
239+
env:
240+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,35 @@ indra_db = "0.1"
3030

3131
### As a CLI
3232

33+
**Via cargo:**
3334
```bash
3435
cargo install indra_db
3536
```
3637

38+
**Via prebuilt binary:**
39+
40+
Download the latest release for your platform from [GitHub Releases](https://github.com/moonstripe/indra_db/releases):
41+
42+
```bash
43+
# macOS (Apple Silicon)
44+
curl -L https://github.com/moonstripe/indra_db/releases/latest/download/indra-aarch64-apple-darwin.tar.gz | tar xz
45+
chmod +x indra
46+
sudo mv indra /usr/local/bin/
47+
48+
# Linux x86_64
49+
curl -L https://github.com/moonstripe/indra_db/releases/latest/download/indra-x86_64-unknown-linux-gnu.tar.gz | tar xz
50+
chmod +x indra
51+
sudo mv indra /usr/local/bin/
52+
53+
# Windows (PowerShell)
54+
# Download from releases page and add to PATH
55+
```
56+
57+
Binaries are available for:
58+
- macOS (Intel + Apple Silicon)
59+
- Linux (x86_64, ARM64, ARMv7, musl variants)
60+
- Windows (x86_64 + ARM64)
61+
3762
## Quick Start
3863

3964
### CLI Usage
@@ -189,7 +214,7 @@ server.tool("search_thoughts", { query: "string", limit: "number?" }, async ({ q
189214
// ... more tools
190215
```
191216

192-
See [indra-mcp](https://github.com/moonstripe/indra-mcp) for a complete MCP server implementation.
217+
An MCP server implementation is planned as a separate npm package.
193218

194219
## Architecture
195220

0 commit comments

Comments
 (0)