Skip to content

Commit 22e4816

Browse files
committed
Merge pull request 'chore: publish terraphim-service to GitHub public mirror' (#5) from publish/github-mirror into main
2 parents 0fb9469 + 3a84b0d commit 22e4816

13 files changed

Lines changed: 127 additions & 40 deletions

File tree

.cargo/config.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
[registry]
22
global-credential-providers = ["cargo:token"]
33

4-
[registries.terraphim]
5-
index = "sparse+https://git.terraphim.cloud/api/packages/terraphim/cargo/"

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
workflow_dispatch:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dtolnay/rust-toolchain@stable
19+
with:
20+
components: rustfmt, clippy
21+
- uses: Swatinem/rust-cache@v2
22+
- run: cargo fmt --all -- --check
23+
- run: cargo clippy --workspace --all-targets -- -D warnings
24+
- run: cargo build --workspace
25+
- run: cargo test --workspace --lib --no-fail-fast
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish Crates
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
crate_list:
6+
description: Space-separated crate package names to publish in order
7+
required: true
8+
type: string
9+
dry_run:
10+
description: Run cargo publish --dry-run only
11+
required: false
12+
default: "true"
13+
type: choice
14+
options: ["true", "false"]
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
publish:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dtolnay/rust-toolchain@stable
27+
- uses: Swatinem/rust-cache@v2
28+
- name: Publish crates in dependency order
29+
env:
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
CRATE_LIST: ${{ inputs.crate_list }}
32+
DRY_RUN: ${{ inputs.dry_run }}
33+
run: |
34+
set -euo pipefail
35+
for crate in $CRATE_LIST; do
36+
manifest="crates/$crate/Cargo.toml"
37+
if [ ! -f "$manifest" ]; then
38+
echo "Missing manifest for $crate at $manifest" >&2
39+
exit 1
40+
fi
41+
version=$(grep -m1 '^version' "$manifest" | sed 's/.*"\(.*\)".*/\1/')
42+
# Check crates.io with auth to avoid rate limits
43+
if curl -fsS -H "Authorization: ${CARGO_REGISTRY_TOKEN}" "https://crates.io/api/v1/crates/$crate/$version" >/dev/null 2>&1; then
44+
echo "$crate $version already exists on crates.io; skipping"
45+
continue
46+
fi
47+
if [ "$DRY_RUN" = "true" ]; then
48+
cargo publish --manifest-path "$manifest" --dry-run
49+
else
50+
set +e
51+
output=$(cargo publish --manifest-path "$manifest" 2>&1)
52+
exit_code=$?
53+
set -e
54+
if [ "$exit_code" -ne 0 ]; then
55+
if echo "$output" | grep -qi "already exists"; then
56+
echo "$crate $version already exists on crates.io; skipping"
57+
continue
58+
fi
59+
echo "$output" >&2
60+
echo "ERROR: Failed to publish $crate" >&2
61+
exit 1
62+
fi
63+
fi
64+
done

crates/haystack_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["ai", "haystack", "core", "traits", "integrations"]
1212
readme = "../../README.md"
1313

1414
[dependencies]
15-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
15+
terraphim_types = { version = "1.0.0" }
1616

1717
[dev-dependencies]
1818
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

crates/haystack_grepapp/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ keywords = ["ai", "grep", "github", "code-search", "haystack"]
1212
readme = "../../README.md"
1313

1414
[dependencies]
15-
haystack_core = { path = "../haystack_core", version = "1.19.2", registry = "terraphim" }
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
15+
haystack_core = { path = "../haystack_core", version = "1.19.2" }
16+
terraphim_types = { version = "1.0.0" }
1717
reqwest = { workspace = true, features = ["json", "rustls-tls"] }
1818

1919
tokio = { workspace = true, features = ["full"] }

crates/haystack_jmap/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ license = "MIT"
1111
readme = "../../README.md"
1212

1313
[dependencies]
14-
haystack_core = { path = "../haystack_core", version = "1.19.3", registry = "terraphim" }
15-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
14+
haystack_core = { path = "../haystack_core", version = "1.19.3" }
15+
terraphim_types = { version = "1.0.0" }
1616
reqwest = { workspace = true, features = ["json", "rustls-tls"] }
1717

1818
tokio = { workspace = true, features = ["full"] }

crates/terraphim-session-analyzer/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ tracing = { workspace = true }
7878
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
7979

8080
# Feature-gated Terraphim dependencies (sibling crates in workspace)
81-
terraphim_automata = { version = "1.19.2", registry = "terraphim", optional = true }
82-
terraphim_types = { version = "1.0.0", registry = "terraphim", optional = true }
83-
terraphim_config = { version = "1.0.0", optional = true, registry = "terraphim" }
81+
terraphim_automata = { version = "1.19.2", optional = true }
82+
terraphim_types = { version = "1.0.0", optional = true }
83+
terraphim_config = { version = "1.0.0", optional = true }
8484

8585
# Feature-gated connector dependencies
8686
rusqlite = { version = "0.32", features = ["bundled"], optional = true }

crates/terraphim_file_search/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ license = "Apache-2.0"
1212
readme = "../../README.md"
1313

1414
[dependencies]
15-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
16-
terraphim_types = { version = "1.15.0", registry = "terraphim" }
15+
terraphim_automata = { version = "1.19.2" }
16+
terraphim_types = { version = "1.15.0" }
1717
fff-search = { version = "0.8.4" }
1818

1919
ahash = "0.8"

crates/terraphim_middleware/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ readme = "../../README.md"
1313

1414

1515
[dependencies]
16-
terraphim_config = { version = "1.0.0", registry = "terraphim" }
17-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
18-
terraphim_automata = { version = "1.19.2", registry = "terraphim", features = ["tokio-runtime"] }
19-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
20-
terraphim_persistence = { version = "1.0.0", registry = "terraphim" }
21-
haystack_jmap = { path = "../haystack_jmap", version = "1.19.2", optional = true, registry = "terraphim" }
16+
terraphim_config = { version = "1.0.0" }
17+
terraphim_rolegraph = { version = "1.0.0" }
18+
terraphim_automata = { version = "1.19.2", features = ["tokio-runtime"] }
19+
terraphim_types = { version = "1.0.0" }
20+
terraphim_persistence = { version = "1.0.0" }
21+
haystack_jmap = { path = "../haystack_jmap", version = "1.19.2", optional = true }
2222
# NOTE: Atomic Data Server commented out for crates.io publishing (not published yet)
2323
# terraphim_atomic_client = { path = "../terraphim_atomic_client", version = "1.0.0", features = ["native"], optional = true }
24-
grepapp_haystack = { path = "../haystack_grepapp", version = "1.19.2", optional = true, registry = "terraphim" }
24+
grepapp_haystack = { path = "../haystack_grepapp", version = "1.19.2", optional = true }
2525
terraphim-session-analyzer = { path = "../terraphim-session-analyzer", version = "1.19.2", features = ["connectors"], optional = true }
2626
jiff = { version = "0.2", optional = true }
2727
home = { version = "0.5", optional = true }
@@ -41,7 +41,7 @@ tokio = { workspace = true, features = ["full"] }
4141
html2md = "0.2.15"
4242
async-trait = { workspace = true }
4343
fff-search = { version = "0.8.4" }
44-
terraphim_file_search = { path = "../terraphim_file_search", version = "1.20.0", registry = "terraphim" }
44+
terraphim_file_search = { path = "../terraphim_file_search", version = "1.20.0" }
4545

4646
url = "2.5"
4747
urlencoding = "2.1"
@@ -52,9 +52,9 @@ reqwest-eventsource = { version = "0.6", optional = true }
5252
rmcp = { version = "0.9", features = ["client", "transport-child-process"], optional = true }
5353

5454
[dev-dependencies]
55-
terraphim_persistence = { version = "1.20.2", features = ["memory"], registry = "terraphim" }
56-
terraphim_settings = { version = "1.20.2", registry = "terraphim" }
57-
terraphim_test_utils = { version = "1.20.3", registry = "terraphim" }
55+
terraphim_persistence = { version = "1.20.2", features = ["memory"] }
56+
terraphim_settings = { version = "1.20.2" }
57+
terraphim_test_utils = { version = "1.20.3" }
5858
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
5959

6060
futures = "0.3"

crates/terraphim_router/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ readme = "../../README.md"
1313

1414
[dependencies]
1515
# Terraphim internal crates
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
16+
terraphim_types = { version = "1.0.0" }
1717

1818
# Core dependencies
1919
serde = { workspace = true, features = ["derive"] }
@@ -37,7 +37,7 @@ dirs = "5.0"
3737
[dependencies.terraphim_persistence]
3838
version = "1.0.0"
3939
optional = true
40-
registry = "terraphim"
40+
4141

4242
# Optional file-watching support
4343
[dependencies.notify]
@@ -58,7 +58,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
5858
serial_test = "3.2"
5959
criterion = "0.8"
6060
proptest = "1.4"
61-
terraphim_persistence = { version = "1.20.2", registry = "terraphim" }
61+
terraphim_persistence = { version = "1.20.2" }
6262
terraphim_spawner = { path = "../terraphim_spawner" }
6363

6464
[[bench]]

0 commit comments

Comments
 (0)