Skip to content

Commit 95e2811

Browse files
author
Alex
committed
chore: strip Gitea registry refs for crates.io publish
1 parent 1f0b8ab commit 95e2811

12 files changed

Lines changed: 129 additions & 43 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_evolution/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ uuid = { workspace = true, features = ["v4", "serde"] }
3131

3232

3333
# Terraphim dependencies
34-
terraphim_persistence = { version = "1.15.0", registry = "terraphim" }
35-
terraphim_types = { version = "1.15.0", registry = "terraphim" }
34+
terraphim_persistence = { version = "1.15.0" }
35+
terraphim_types = { version = "1.15.0" }
3636

3737
[dev-dependencies]
3838
tokio-test = "0.4"

crates/terraphim_agent_messaging/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_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2", registry = "terraphim" }
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
15+
terraphim_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2" }
16+
terraphim_types = { version = "1.0.0" }
1717

1818
# Core async runtime and utilities
1919
tokio = { workspace = true }

crates/terraphim_agent_registry/Cargo.toml

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

1414
[dependencies]
1515
# Core Terraphim dependencies
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
17-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
18-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
19-
terraphim_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2", registry = "terraphim" }
20-
terraphim_agent_messaging = { path = "../terraphim_agent_messaging", version = "1.19.2", registry = "terraphim" }
16+
terraphim_types = { version = "1.0.0" }
17+
terraphim_automata = { version = "1.19.2" }
18+
terraphim_rolegraph = { version = "1.0.0" }
19+
terraphim_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2" }
20+
terraphim_agent_messaging = { path = "../terraphim_agent_messaging", version = "1.19.2" }
2121

2222
# Core async runtime and utilities
2323
tokio = { workspace = true }

crates/terraphim_agent_supervisor/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_persistence = { version = "1.0.0", registry = "terraphim" }
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
15+
terraphim_persistence = { version = "1.0.0" }
16+
terraphim_types = { version = "1.0.0" }
1717

1818
# Core async runtime and utilities
1919
tokio = { workspace = true }

crates/terraphim_goal_alignment/Cargo.toml

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

1414
[dependencies]
1515
# Core Terraphim dependencies
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
17-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
18-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
19-
terraphim_agent_registry = { path = "../terraphim_agent_registry", version = "1.19.2", registry = "terraphim" }
16+
terraphim_types = { version = "1.0.0" }
17+
terraphim_automata = { version = "1.19.2" }
18+
terraphim_rolegraph = { version = "1.0.0" }
19+
terraphim_agent_registry = { path = "../terraphim_agent_registry", version = "1.19.2" }
2020

2121
# Core async runtime and utilities
2222
tokio = { workspace = true }

crates/terraphim_kg_orchestration/Cargo.toml

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

1414
[dependencies]
1515
# Core Terraphim dependencies
16-
terraphim_types = { version = "1.0.0", registry = "terraphim" }
17-
terraphim_automata = { version = "1.19.2", registry = "terraphim" }
18-
terraphim_rolegraph = { version = "1.0.0", registry = "terraphim" }
19-
terraphim_task_decomposition = { path = "../terraphim_task_decomposition", version = "1.0.0", registry = "terraphim" }
20-
terraphim_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2", registry = "terraphim" }
16+
terraphim_types = { version = "1.0.0" }
17+
terraphim_automata = { version = "1.19.2" }
18+
terraphim_rolegraph = { version = "1.0.0" }
19+
terraphim_task_decomposition = { path = "../terraphim_task_decomposition", version = "1.0.0" }
20+
terraphim_agent_supervisor = { path = "../terraphim_agent_supervisor", version = "1.19.2" }
2121

2222
# Core async runtime and utilities
2323
tokio = { workspace = true }

crates/terraphim_multi_agent/Cargo.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ license = "MIT"
1111
# Restrict publishing to the private Terraphim registry (was `false`; the
1212
# polyrepo split (Gitea #1910) requires this crate on the terraphim registry,
1313
# but it must never go to crates.io).
14-
publish = ["terraphim"]
1514
readme = "../../README.md"
1615

1716
[features]
@@ -48,15 +47,15 @@ tracing = { workspace = true }
4847
regex = "1.12"
4948

5049
# Terraphim dependencies
51-
terraphim_types = { version = "1.20.2", registry = "terraphim" }
52-
terraphim_config = { version = "1.20.2", features = ["openrouter"], registry = "terraphim" }
53-
terraphim_rolegraph = { version = "1.20.2", registry = "terraphim" }
54-
terraphim_automata = { version = "1.20.2", registry = "terraphim" }
55-
terraphim_persistence = { version = "1.20.2", registry = "terraphim" }
56-
terraphim_agent_evolution = { path = "../terraphim_agent_evolution", version = "1.20.2", registry = "terraphim" }
57-
terraphim_service = { version = "1.20.2", registry = "terraphim" }
58-
terraphim_agent_registry = { path = "../terraphim_agent_registry", version = "1.19.2", registry = "terraphim" }
59-
terraphim_usage = { version = "1.20.3", registry = "terraphim" }
50+
terraphim_types = { version = "1.20.2" }
51+
terraphim_config = { version = "1.20.2", features = ["openrouter"] }
52+
terraphim_rolegraph = { version = "1.20.2" }
53+
terraphim_automata = { version = "1.20.2" }
54+
terraphim_persistence = { version = "1.20.2" }
55+
terraphim_agent_evolution = { path = "../terraphim_agent_evolution", version = "1.20.2" }
56+
terraphim_service = { version = "1.20.2" }
57+
terraphim_agent_registry = { path = "../terraphim_agent_registry", version = "1.19.2" }
58+
terraphim_usage = { version = "1.20.3" }
6059

6160
# Firecracker VM dependencies (optional, feature-gated)
6261
# Note: fcctl-repl has its own workspace dependencies that may conflict
@@ -68,7 +67,7 @@ tempfile = { workspace = true }
6867

6968
criterion = { version = "0.8", features = ["html_reports"] }
7069
# Enable test-utils for examples and benchmarks
71-
terraphim_multi_agent = { path = ".", features = ["test-utils"], registry = "terraphim" }
70+
terraphim_multi_agent = { path = ".", features = ["test-utils"] }
7271

7372
[[bench]]
7473
name = "agent_operations"

0 commit comments

Comments
 (0)