Skip to content

Commit d151c3c

Browse files
Publishes crates in dependency order
Publishes crates in phases based on their dependencies to ensure that crates.io has the necessary dependencies available during the publishing process. Adds a version flag to the cortex binary.
1 parent 6f80883 commit d151c3c

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,47 @@ jobs:
170170
sudo apt-get update
171171
sudo apt-get install -y libsodium-dev libssl-dev pkg-config
172172
173+
# Phase 1: Crates with no internal dependencies
174+
- name: Publish aingle_graph
175+
run: cargo publish -p aingle_graph --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
176+
continue-on-error: true
177+
178+
- name: Publish aingle_zk
179+
run: cargo publish -p aingle_zk --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
180+
continue-on-error: true
181+
182+
- name: Publish titans_memory
183+
run: cargo publish -p titans_memory --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
184+
continue-on-error: true
185+
186+
- name: Publish aingle_ai
187+
run: cargo publish -p aingle_ai --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
188+
continue-on-error: true
189+
190+
- name: Publish ai_hash
191+
run: cargo publish -p ai_hash --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
192+
continue-on-error: true
193+
194+
- name: Wait for crates.io index update
195+
run: sleep 30
196+
197+
# Phase 2: Crates depending on Phase 1
173198
- name: Publish aingle_zome_types
174199
run: cargo publish -p aingle_zome_types --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
175200
continue-on-error: true
176201

202+
- name: Publish aingle_logic
203+
run: cargo publish -p aingle_logic --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
204+
continue-on-error: true
205+
206+
- name: Publish hope_agents
207+
run: cargo publish -p hope_agents --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
208+
continue-on-error: true
209+
210+
- name: Wait for crates.io index update
211+
run: sleep 30
212+
213+
# Phase 3: Crates depending on Phase 2
177214
- name: Publish aingle_cortex
178215
run: cargo publish -p aingle_cortex --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
179216
continue-on-error: true

crates/aingle_cortex/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
1919
// Parse command line arguments
2020
let args: Vec<String> = std::env::args().collect();
2121

22+
// Handle --version before anything else (no server init needed)
23+
if args.iter().any(|a| a == "--version" || a == "-V") {
24+
println!("{}", env!("CARGO_PKG_VERSION"));
25+
return Ok(());
26+
}
27+
2228
let mut config = CortexConfig::default();
2329

2430
// Simple argument parsing
@@ -75,6 +81,7 @@ fn print_help() {
7581
println!(" -h, --host <HOST> Host to bind to (default: 127.0.0.1)");
7682
println!(" -p, --port <PORT> Port to listen on (default: 8080)");
7783
println!(" --public Bind to all interfaces (0.0.0.0)");
84+
println!(" -V, --version Print version and exit");
7885
println!(" --help Print this help message");
7986
println!();
8087
println!("ENDPOINTS:");

0 commit comments

Comments
 (0)