Skip to content

Commit 8d0e64d

Browse files
committed
Configure cargo-dist releases
1 parent b30037f commit 8d0e64d

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
plan:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
matrix: ${{ steps.set-matrix.outputs.matrix }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install cargo-dist
16+
run: cargo install cargo-dist --version 0.22.0
17+
- name: Create matrix
18+
id: set-matrix
19+
run: |
20+
cat > matrix.json <<'JSON'
21+
{"include":[{"target":"x86_64-unknown-linux-gnu","archive":"tar.gz","runner":"ubuntu-latest"},{"target":"aarch64-unknown-linux-gnu","archive":"tar.gz","runner":"ubuntu-latest"},{"target":"x86_64-apple-darwin","archive":"tar.gz","runner":"macos-latest"},{"target":"aarch64-apple-darwin","archive":"tar.gz","runner":"macos-latest"},{"target":"x86_64-pc-windows-msvc","archive":"zip","runner":"windows-latest"}]}
22+
JSON
23+
MATRIX=$(cat matrix.json)
24+
echo "::set-output name=matrix::${MATRIX}"
25+
26+
build:
27+
needs: plan
28+
runs-on: ${{ matrix.runner }}
29+
strategy:
30+
fail-fast: false
31+
matrix: ${{ fromJson(needs.plan.outputs.matrix) }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set up Rust
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
toolchain: stable
38+
profile: minimal
39+
override: true
40+
- name: Add target
41+
run: |
42+
rustup target add ${{ matrix.target }} || true
43+
- name: Build release
44+
run: |
45+
cargo build --release --target ${{ matrix.target }}
46+
- name: Archive artifact
47+
if: ${{ matrix.archive == 'tar.gz' }}
48+
run: |
49+
ART="doora-${{ matrix.target }}"
50+
mkdir -p dist
51+
cp target/${{ matrix.target }}/release/doora dist/${ART}
52+
tar -czf dist/${ART}.tar.gz -C dist ${ART}
53+
- name: Zip artifact
54+
if: ${{ matrix.archive == 'zip' }}
55+
run: |
56+
ART="doora-${{ matrix.target }}"
57+
mkdir -p dist
58+
cp target/${{ matrix.target }}/release/doora.exe dist/${ART}.exe
59+
cd dist && zip ${ART}.zip ${ART}.exe
60+
- name: Upload artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ matrix.target }}-artifact
64+
path: dist
65+
66+
publish:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Install cargo-dist
72+
run: cargo install cargo-dist --version 0.22.0
73+
- name: Publish release
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
run: |
77+
cargo dist upload --no-build

Cargo.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,30 @@
22
name = "doora"
33
version = "0.1.0"
44
edition = "2021"
5+
description = "Doora parses source files into syntax trees and runs S-expression queries to find functions, types, and call sites that grep misses. Supports Rust, Python, JS, TS, Go, C, and C++. Exposes an MCP server so AI agents understand your codebase semantically, cutting hallucinations and wasted context tokens."
6+
authors = ["backpack-lab"]
7+
license = "MIT"
8+
repository = "https://github.com/backpack-lab/doora"
9+
homepage = "https://github.com/backpack-lab/doora"
10+
keywords = ["rust", "cli", "tree-sitter", "mcp", "ast", "code-search", "developer-tools", "query-engine", "rayon", "llm", "ai-coding", "grep-alternative", "structural-search"]
11+
categories = ["command-line-utilities", "development-tools"]
12+
readme = "README.md"
13+
exclude = [
14+
"tests/fixtures/",
15+
"benches/",
16+
"scripts/",
17+
"docs/",
18+
".github/",
19+
]
520

621
[profile.release]
722
debug = 1
823

24+
# The profile that 'cargo dist' will build with
25+
[profile.dist]
26+
inherits = "release"
27+
lto = "thin"
28+
929
[[bin]]
1030
name = "doora"
1131
path = "src/main.rs"
@@ -46,3 +66,18 @@ criterion = { version = "0.5", features = ["html_reports"] }
4666
[[bench]]
4767
name = "search_benchmarks"
4868
harness = false
69+
70+
[workspace.metadata.dist]
71+
cargo-dist-version = "0.22.0"
72+
ci = ["github"]
73+
installers = ["shell", "powershell"]
74+
targets = [
75+
"x86_64-unknown-linux-gnu",
76+
"aarch64-unknown-linux-gnu",
77+
"x86_64-apple-darwin",
78+
"aarch64-apple-darwin",
79+
"x86_64-pc-windows-msvc",
80+
]
81+
install-path = "CARGO_HOME"
82+
publish-jobs = ["cargo"]
83+

0 commit comments

Comments
 (0)