Skip to content

Commit eab8c43

Browse files
author
Alex
committed
chore: strip Gitea registry refs for crates.io publish
1 parent 6c54b03 commit eab8c43

12 files changed

Lines changed: 148 additions & 61 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/terraphim_agent/Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
5151
log = { workspace = true }
5252
urlencoding = { version = "2.1", optional = true }
5353
ahash = "0.8"
54-
terraphim_update = { path = "../terraphim_update", version = "1.0.0", registry = "terraphim" }
54+
terraphim_update = { path = "../terraphim_update", version = "1.0.0" }
5555
pulldown-cmark = { version = "0.13", default-features = false, features = ["html"] }
5656
regex = "1.12"
5757
glob = "0.3"
@@ -68,20 +68,20 @@ colored = { version = "3.0", optional = true }
6868
comfy-table = { version = "7.0", optional = true }
6969
dirs = { version = "5.0" }
7070
directories = "5.0"
71-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
72-
terraphim_settings = { version = "1.0.0", registry = "terraphim" }
73-
terraphim_persistence = { version = "1.0.0", registry = "terraphim" }
74-
terraphim_config = { version = "1.0.0", registry = "terraphim" }
75-
terraphim_command_runtime = { path = "../terraphim_command_runtime", version = "0.1.0", registry = "terraphim" }
76-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
77-
terraphim_service = { version = "1.0.0", default-features = false, registry = "terraphim" }
78-
terraphim_middleware = { version = "1.0.0", registry = "terraphim" }
79-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
80-
terraphim_hooks = { path = "../terraphim_hooks", version = "1.0.0", registry = "terraphim" }
81-
terraphim_tracker = { version = "1.0.0", registry = "terraphim" }
82-
terraphim_orchestrator = { version = "1.0.0", registry = "terraphim" }
71+
terraphim_types = { version = "1.0.0" }
72+
terraphim_settings = { version = "1.0.0" }
73+
terraphim_persistence = { version = "1.0.0" }
74+
terraphim_config = { version = "1.0.0" }
75+
terraphim_command_runtime = { path = "../terraphim_command_runtime", version = "0.1.0" }
76+
terraphim_automata = { version = "1.19.2" }
77+
terraphim_service = { version = "1.0.0", default-features = false }
78+
terraphim_middleware = { version = "1.0.0" }
79+
terraphim_rolegraph = { version = "1.0.0" }
80+
terraphim_hooks = { path = "../terraphim_hooks", version = "1.0.0" }
81+
terraphim_tracker = { version = "1.0.0" }
82+
terraphim_orchestrator = { version = "1.0.0" }
8383
# Session search - uses workspace version (path for dev, version for crates.io)
84-
terraphim_sessions = { path = "../terraphim_sessions", version = "1.6.0", optional = true, features = ["tsa-full", "aider-connector", "search-index"], registry = "terraphim" }
84+
terraphim_sessions = { path = "../terraphim_sessions", version = "1.6.0", optional = true, features = ["tsa-full", "aider-connector", "search-index"] }
8585

8686
[dev-dependencies]
8787
assert_cmd = "2"
@@ -94,7 +94,7 @@ tokio = { workspace = true }
9494
tempfile = { workspace = true }
9595
wiremock = "0.6"
9696

97-
terraphim_test_utils = { version = "1.20.3", registry = "terraphim" }
97+
terraphim_test_utils = { version = "1.20.3" }
9898
insta = { version = "1.41", features = ["yaml", "redactions"] }
9999

100100
# Enable REPL features for testing

crates/terraphim_cli/Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ path = "src/main.rs"
1818

1919
[dependencies]
2020
# Core terraphim crates
21-
terraphim_service = { version = "1.0.0", registry = "terraphim" }
22-
terraphim_config = { version = "1.0.0", registry = "terraphim" }
23-
terraphim_command_runtime = { path = "../terraphim_command_runtime", version = "0.1.0", registry = "terraphim" }
24-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
25-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
26-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
27-
terraphim_settings = { version = "1.0.0", registry = "terraphim" }
28-
terraphim_persistence = { version = "1.0.0", registry = "terraphim" }
29-
terraphim_update = { path = "../terraphim_update", version = "1.0.0", registry = "terraphim" }
30-
terraphim_hooks = { path = "../terraphim_hooks", version = "1.0.0", registry = "terraphim" }
21+
terraphim_service = { version = "1.0.0" }
22+
terraphim_config = { version = "1.0.0" }
23+
terraphim_command_runtime = { path = "../terraphim_command_runtime", version = "0.1.0" }
24+
terraphim_types = { version = "1.0.0" }
25+
terraphim_automata = { version = "1.19.2" }
26+
terraphim_rolegraph = { version = "1.0.0" }
27+
terraphim_settings = { version = "1.0.0" }
28+
terraphim_persistence = { version = "1.0.0" }
29+
terraphim_update = { path = "../terraphim_update", version = "1.0.0" }
30+
terraphim_hooks = { path = "../terraphim_hooks", version = "1.0.0" }
3131

3232
# Usage tracking (feature-gated)
33-
terraphim_usage = { version = "1.20.3", optional = true, features = ["cli", "providers"], registry = "terraphim" }
33+
terraphim_usage = { version = "1.20.3", optional = true, features = ["cli", "providers"] }
3434

3535
# CLI framework
3636
clap = { version = "4.5", features = ["derive", "cargo", "env"] }

crates/terraphim_command_runtime/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/terraphim/terraphim-ai"
1111
readme = "../../README.md"
1212

1313
[dependencies]
14-
terraphim_config = { version = "1.0.0", registry = "terraphim" }
15-
terraphim_persistence = { version = "1.0.0", registry = "terraphim" }
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
14+
terraphim_config = { version = "1.0.0" }
15+
terraphim_persistence = { version = "1.0.0" }
16+
terraphim_types = { version = "1.0.0" }
1717
anyhow = { workspace = true }

crates/terraphim_grep/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ log.workspace = true
2525
# the release version; the field's *presence* is what the publisher requires. The
2626
# value here must match each crate's currently-declared local version so path
2727
# resolution succeeds for local builds.
28-
terraphim_types = { version = "1.15.0", registry = "terraphim" }
29-
terraphim_rolegraph = { version = "1.15.0", registry = "terraphim" }
30-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
31-
terraphim_service = { version = "1.16.15", optional = true, registry = "terraphim" }
32-
terraphim_config = { version = "1.15.0", registry = "terraphim" }
28+
terraphim_types = { version = "1.15.0" }
29+
terraphim_rolegraph = { version = "1.15.0" }
30+
terraphim_automata = { version = "1.19.2" }
31+
terraphim_service = { version = "1.16.15", optional = true }
32+
terraphim_config = { version = "1.15.0" }
3333

3434
fff-search = { version = "0.8.4", optional = true }
3535

@@ -51,7 +51,7 @@ openrouter = ["llm", "terraphim_service/openrouter"]
5151
tokio-test = "0.4"
5252
tempfile.workspace = true
5353
criterion = { version = "0.8", features = ["async_tokio"] }
54-
terraphim_router = { version = "1.8.0", registry = "terraphim" }
54+
terraphim_router = { version = "1.8.0" }
5555

5656
[[bin]]
5757
name = "terraphim-grep"

crates/terraphim_hooks/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.0.0", registry = "terraphim" }
15+
terraphim_automata = { version = "1.19.2" }
16+
terraphim_types = { version = "1.0.0" }
1717
thiserror = { workspace = true }
1818

1919
serde = { workspace = true, features = ["derive"] }

crates/terraphim_lsp/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ path = "src/bin/terraphim-lsp.rs"
2121
required-features = ["terraphim-lsp"]
2222

2323
[dependencies]
24-
terraphim_negative_contribution = { path = "../terraphim_negative_contribution", version = "0.1.0", registry = "terraphim" }
25-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
24+
terraphim_negative_contribution = { path = "../terraphim_negative_contribution", version = "0.1.0" }
25+
terraphim_types = { version = "1.0.0" }
2626
tower-lsp = "0.20"
2727
tokio = { workspace = true, features = ["full"] }
2828
serde = { workspace = true, features = ["derive"] }

crates/terraphim_mcp_server/Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ rmcp = { version = "0.9.0", features = ["server", "transport-sse-server", "trans
2424
serde_json = { workspace = true }
2525

2626
fff-search = { version = "0.8.4" }
27-
terraphim_automata = { version = "1.20.2", registry = "terraphim", features = ["tokio-runtime"] }
28-
terraphim_config = { version = "1.20.2", registry = "terraphim" }
29-
terraphim_file_search = { version = "1.20.3", registry = "terraphim" }
30-
terraphim_hooks = { version = "1.20.2", path = "../terraphim_hooks", registry = "terraphim" }
31-
terraphim_rolegraph = { version = "1.20.2", registry = "terraphim" }
32-
terraphim_service = { version = "1.20.2", registry = "terraphim" }
33-
terraphim_types = { version = "1.20.2", registry = "terraphim" }
27+
terraphim_automata = { version = "1.20.2", features = ["tokio-runtime"] }
28+
terraphim_config = { version = "1.20.2" }
29+
terraphim_file_search = { version = "1.20.3" }
30+
terraphim_hooks = { version = "1.20.2", path = "../terraphim_hooks" }
31+
terraphim_rolegraph = { version = "1.20.2" }
32+
terraphim_service = { version = "1.20.2" }
33+
terraphim_types = { version = "1.20.2" }
3434
thiserror = { workspace = true }
3535

3636
tokio = { workspace = true, features = ["full"] }
@@ -59,10 +59,10 @@ serde_json = { workspace = true }
5959
serial_test = "3.3"
6060
tempfile = { workspace = true }
6161

62-
terraphim_automata = { version = "1.20.2", registry = "terraphim" } # For AutomataPath
63-
terraphim_config = { version = "1.20.2", registry = "terraphim" }
64-
terraphim_middleware = { version = "1.20.3", registry = "terraphim" } # For Logseq builder
65-
terraphim_persistence = { version = "1.20.2", features = ["memory"], registry = "terraphim" }
66-
terraphim_file_search = { version = "1.20.3", registry = "terraphim" }
67-
terraphim_test_utils = { version = "1.20.3", registry = "terraphim" }
62+
terraphim_automata = { version = "1.20.2" } # For AutomataPath
63+
terraphim_config = { version = "1.20.2" }
64+
terraphim_middleware = { version = "1.20.3" } # For Logseq builder
65+
terraphim_persistence = { version = "1.20.2", features = ["memory"] }
66+
terraphim_file_search = { version = "1.20.3" }
67+
terraphim_test_utils = { version = "1.20.3" }
6868
env_logger = "0.11"

0 commit comments

Comments
 (0)