Skip to content

Commit 3b0f440

Browse files
MarkShawn2020claude
andcommitted
ci: cross-platform CLI release workflow + workspace CI + crates.io metadata
Phase 2.5. .github/workflows/cli-release.yml — on tag push (v*): - Build lovcode-cli release binaries on a 5-target matrix: aarch64-apple-darwin, x86_64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu (via cross), x86_64-pc-windows-msvc. - Stage each binary with README + LICENSE; tar.gz on unix, zip on windows; attach to the GitHub Release via softprops/action-gh-release. .github/workflows/ci.yml — on push to main / PR: - Rust matrix (macos-14, ubuntu-22.04, windows-2022) running `cargo check` + `cargo clippy -D warnings` for the three non-Tauri crates (locked). - Frontend job: `pnpm build`. Crate metadata for crates.io: - All three published crates now have readme, keywords, categories. Cleanup: - Drop dead .changeset/ + scripts/bump-version.cjs + scripts/sync-cargo-version.cjs + old changesets-based release.yml. Their tools and the surrounding workflow were v0.39 era and weren't even installed in the slimmed package.json. - Pin Node >= 20 in package.json engines. Pre-flight: cargo clippy clean (one rmcp macro-injected field marked allow(dead_code) with a comment). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 53641c3 commit 3b0f440

13 files changed

Lines changed: 143 additions & 309 deletions

File tree

.changeset/README.md

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

.changeset/config.json

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

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CARGO_INCREMENTAL: 0
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
rust:
14+
name: Rust (${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-14, ubuntu-22.04, windows-2022]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: dtolnay/rust-toolchain@stable
23+
with:
24+
components: clippy
25+
- uses: Swatinem/rust-cache@v2
26+
with:
27+
shared-key: ci-${{ matrix.os }}
28+
- name: cargo check (lovcode-core, lovcode-cli, lovcode-mcp)
29+
run: cargo check -p lovcode-core -p lovcode-cli -p lovcode-mcp --locked
30+
- name: cargo clippy (non-Tauri crates)
31+
run: cargo clippy -p lovcode-core -p lovcode-cli -p lovcode-mcp --no-deps -- -D warnings
32+
33+
frontend:
34+
name: Frontend
35+
runs-on: ubuntu-22.04
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: pnpm/action-setup@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
cache: pnpm
43+
- run: pnpm install --frozen-lockfile
44+
- run: pnpm build

.github/workflows/cli-release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CLI Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Tag to build (e.g. v0.40.0)"
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
env:
17+
CARGO_INCREMENTAL: 0
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
build:
22+
name: ${{ matrix.target }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- { os: macos-14, target: aarch64-apple-darwin, archive: tar.gz }
29+
- { os: macos-13, target: x86_64-apple-darwin, archive: tar.gz }
30+
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, archive: tar.gz }
31+
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, archive: tar.gz, cross: true }
32+
- { os: windows-2022, target: x86_64-pc-windows-msvc, archive: zip }
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: ${{ matrix.target }}
39+
40+
- uses: Swatinem/rust-cache@v2
41+
with:
42+
shared-key: cli-${{ matrix.target }}
43+
44+
- name: Install cross (for aarch64 linux)
45+
if: matrix.cross == true
46+
run: cargo install cross --locked
47+
48+
- name: Build
49+
shell: bash
50+
run: |
51+
if [[ "${{ matrix.cross }}" == "true" ]]; then
52+
cross build --release -p lovcode-cli --target ${{ matrix.target }}
53+
else
54+
cargo build --release -p lovcode-cli --target ${{ matrix.target }}
55+
fi
56+
57+
- name: Stage artifact
58+
id: stage
59+
shell: bash
60+
run: |
61+
set -euo pipefail
62+
BIN_NAME=lovcode
63+
if [[ "${{ matrix.target }}" == *windows* ]]; then BIN_NAME=lovcode.exe; fi
64+
TAG="${GITHUB_REF_NAME:-${{ github.event.inputs.tag }}}"
65+
STAGE="lovcode-${TAG}-${{ matrix.target }}"
66+
mkdir -p "$STAGE"
67+
cp "target/${{ matrix.target }}/release/$BIN_NAME" "$STAGE/"
68+
cp README.md LICENSE "$STAGE/" || true
69+
if [[ "${{ matrix.archive }}" == "zip" ]]; then
70+
7z a "${STAGE}.zip" "$STAGE" > /dev/null
71+
echo "asset=${STAGE}.zip" >> $GITHUB_OUTPUT
72+
else
73+
tar -czf "${STAGE}.tar.gz" "$STAGE"
74+
echo "asset=${STAGE}.tar.gz" >> $GITHUB_OUTPUT
75+
fi
76+
77+
- uses: softprops/action-gh-release@v2
78+
if: github.event_name == 'push'
79+
with:
80+
files: ${{ steps.stage.outputs.asset }}
81+
fail_on_unmatched_files: true
82+
generate_release_notes: true
83+
84+
- uses: actions/upload-artifact@v4
85+
if: github.event_name == 'workflow_dispatch'
86+
with:
87+
name: ${{ steps.stage.outputs.asset }}
88+
path: ${{ steps.stage.outputs.asset }}

.github/workflows/release.yml

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

crates/lovcode-cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ edition.workspace = true
55
license.workspace = true
66
repository.workspace = true
77
description = "Lovcode CLI — search every AI conversation you've ever had."
8+
readme = "../../README.md"
9+
keywords = ["search", "ai", "claude", "mcp", "cli"]
10+
categories = ["command-line-utilities"]
811

912
[[bin]]
1013
name = "lovcode"

crates/lovcode-core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ edition.workspace = true
55
license.workspace = true
66
repository.workspace = true
77
description = "Core library for Lovcode: adapters, index, query, watcher for AI conversation search."
8+
readme = "../../README.md"
9+
keywords = ["search", "ai", "claude", "mcp", "tantivy"]
10+
categories = ["command-line-utilities", "text-processing"]
811

912
[dependencies]
1013
serde = { workspace = true }

crates/lovcode-core/src/import/chatgpt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ struct MapNode {
3636

3737
#[derive(Debug, Deserialize)]
3838
struct GptMsg {
39-
id: Option<String>,
4039
author: Option<Author>,
4140
create_time: Option<f64>,
4241
content: Option<MsgContent>,

crates/lovcode-mcp/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ edition.workspace = true
55
license.workspace = true
66
repository.workspace = true
77
description = "MCP server library for Lovcode — exposes conversation search as MCP tools."
8+
readme = "../../README.md"
9+
keywords = ["mcp", "search", "ai", "claude"]
10+
categories = ["command-line-utilities"]
811

912
[dependencies]
1013
lovcode-core = { path = "../lovcode-core" }

0 commit comments

Comments
 (0)