Skip to content

Commit

Permalink
Merge pull request #211 from dora-rs/add-rust-api-info
Browse files Browse the repository at this point in the history
Make `dora-rs` publishable on `crates.io`
  • Loading branch information
haixuanTao authored Mar 21, 2023
2 parents db82e47 + c112b6b commit 18d2c55
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 97 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,45 @@ jobs:
timeout-minutes: 60
run: "cargo build --release -p dora-runtime
-p dora-coordinator -p dora-cli -p dora-daemon"

- name: "Publish packages on `crates.io`"
if: runner.os == 'Linux'
run: |
# Publishing those crates from outer crates with no dependency to inner crates
# As cargo is going to rebuild the crates based on published dependencies
# we need to publish those outer crates first to be able to test the publication
# of inner crates.
#
# We should preferably test pre-releases before testing releases as
# cargo publish might catch release issues that the workspace manages to fix using
# workspace crates.
# Publish libraries crates
cargo publish -p dora-message --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-tracing --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-metrics --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-download --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p communication-layer-pub-sub --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p communication-layer-request-reply --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p shared-memory-server --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Publish rust API
cargo publish -p dora-operator-api-macros --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-operator-api-types --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-operator-api --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-node-api --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-operator-api-python --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-operator-api-c --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-node-api-c --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Publish binaries crates
cargo publish -p dora-cli --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-coordinator --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-daemon --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p dora-runtime --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: "Create Archive (Unix)"
if: runner.os == 'Linux' || runner.os == 'macOS'
Expand Down
53 changes: 9 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ members = [

[workspace.package]
version = "0.2.0"
description = "`dora` goal is to be a low latency, composable, and distributed data flow."
documentation = "https://dora.carsmos.ai/dora/"
license = "Apache-2.0"

[workspace.dependencies]
dora-node-api = { version = "0.2.0", path = "apis/rust/node", default-features = false }
dora-operator-api = { version = "0.2.0", path = "apis/rust/operator", default-features = false }
dora-operator-api-macros = { version = "0.2.0", path = "apis/rust/operator/macros" }
dora-operator-api-types = { version = "0.2.0", path = "apis/rust/operator/types" }
dora-operator-api-python = { version = "0.2.0", path = "apis/python/operator" }
dora-operator-api-c = { version = "0.2.0", path = "apis/c/operator" }
dora-node-api-c = { version = "0.2.0", path = "apis/c/node" }
dora-core = { version = "0.2.0", path = "libraries/core" }
dora-tracing = { version = "0.2.0", path = "libraries/extensions/telemetry/tracing" }
dora-metrics = { version = "0.2.0", path = "libraries/extensions/telemetry/metrics" }
Expand Down
3 changes: 3 additions & 0 deletions apis/c++/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name = "dora-node-api-cxx"
version.workspace = true
edition = "2021"
documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
7 changes: 3 additions & 4 deletions apis/c++/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
name = "dora-operator-api-cxx"
version.workspace = true
edition = "2021"
documentation.workspace = true
description.workspace = true
license.workspace = true

[lib]
crate-type = ["staticlib"]

[dependencies]
cxx = "1.0.73"
dora-operator-api = { workspace = true }
eyre = "0.6.8"
futures = "0.3.21"
rand = "0.8.5"
tokio = { version = "1.24.2", features = ["rt", "macros"] }

[build-dependencies]
cxx-build = "1.0.73"
8 changes: 6 additions & 2 deletions apis/c/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
name = "dora-node-api-c"
version.workspace = true
edition = "2021"
license = "Apache-2.0"

documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["staticlib"]
crate-type = ["staticlib", "lib"]


[features]
default = ["tracing"]
Expand Down
2 changes: 2 additions & 0 deletions apis/c/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use dora_node_api::{DoraNode, Event, EventStream};
use eyre::Context;
use std::{ffi::c_void, ptr, slice};

pub const HEADER_NODE_API: &str = include_str!("../node_api.h");

struct DoraContext {
node: &'static mut DoraNode,
events: EventStream,
Expand Down
3 changes: 2 additions & 1 deletion apis/c/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
name = "dora-operator-api-c"
version.workspace = true
edition = "2021"
license = "Apache-2.0"
description = "C API implemetation for Dora Operator"
documentation.workspace = true
license.workspace = true

[build-dependencies]
dora-operator-api-types = { workspace = true }
3 changes: 2 additions & 1 deletion apis/c/operator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

pub const HEADER_OPERATOR_API: &str = include_str!("../operator_api.h");
pub const HEADER_OPERATOR_TYPES: &str = include_str!("../operator_types.h");
4 changes: 3 additions & 1 deletion apis/python/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
version.workspace = true
name = "dora-node-api-python"
edition = "2021"
license = "Apache-2.0"
documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 4 additions & 1 deletion apis/python/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
name = "dora-operator-api-python"
version.workspace = true
edition = "2021"
license = "Apache-2.0"

documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 3 additions & 1 deletion apis/rust/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
name = "dora-node-api"
version.workspace = true
edition = "2021"
license = "Apache-2.0"
documentation.workspace = true
description.workspace = true
license.workspace = true

[features]
default = ["tracing"]
Expand Down
5 changes: 3 additions & 2 deletions apis/rust/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
name = "dora-operator-api"
version.workspace = true
edition = "2021"
license = "Apache-2.0"
description = "Rust API implemetation for Dora Operator"
documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
7 changes: 2 additions & 5 deletions apis/rust/operator/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
name = "dora-operator-api-macros"
version.workspace = true
edition = "2021"
license = "Apache-2.0"
description = "Rust API Macros for Dora Operator"
documentation.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -14,7 +15,3 @@ proc-macro = true
syn = { version = "1.0.81", features = ["full"] }
quote = "1.0.10"
proc-macro2 = "1.0.32"

[dev-dependencies]
dora-operator-api = { workspace = true }
dora-operator-api-types = { workspace = true }
3 changes: 3 additions & 0 deletions apis/rust/operator/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name = "dora-operator-api-types"
version.workspace = true
edition = "2021"
documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 5 additions & 1 deletion binaries/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name = "dora-cli"
version.workspace = true
edition = "2021"
documentation.workspace = true
description.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -13,9 +16,10 @@ path = "src/main.rs"
clap = { version = "4.0.3", features = ["derive"] }
eyre = "0.6.8"
dora-core = { workspace = true }
dora-node-api-c = { workspace = true }
dora-operator-api-c = { workspace = true }
serde = { version = "1.0.136", features = ["derive"] }
serde_yaml = "0.9.11"
tempfile = "3.4.0"
webbrowser = "0.8.3"
serde_json = "1.0.86"
termcolor = "1.1.3"
Expand Down
Loading

0 comments on commit 18d2c55

Please sign in to comment.