diff --git a/Cargo.toml b/Cargo.toml index 3f1bd75f..689a1be1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,18 +1,47 @@ -[package] -name = "ttrpc" -version = "0.8.4" -authors = ["The AntFin Kata Team "] +[workspace] +members = [ + "./compiler", + "./ttrpc-codegen", + "./example", + "./" +] +resolver = "2" + +[workspace.package] edition = "2018" license = "Apache-2.0" -keywords = ["ttrpc", "protobuf", "rpc"] readme = "README.md" repository = "https://github.com/containerd/ttrpc-rust" homepage = "https://github.com/containerd/ttrpc-rust" +authors = ["The AntFin Kata Team "] + +[workspace.dependencies] +# The dependencies in this section can be used by the crates in this +# workspace by specifying `workspace = true` instead of the crate +# version. For example, for protobuf: +# protobuf = { workspace = true } +ttrpc = { version = "0.8.4", path = "./" } +ttrpc-codegen = { version = "0.5.0", path = "./ttrpc-codegen" } +ttrpc-compiler = { version = "0.7.0", path = "./compiler" } +protobuf = "3.7.2" +protobuf-codegen = "3.7.2" +protobuf-support = "3.7.2" + +[package] +name = "ttrpc" +version = "0.8.4" +authors = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +keywords = ["ttrpc", "protobuf", "rpc"] +readme = "README.md" description = "A Rust version of ttrpc." rust-version = "1.70" [dependencies] -protobuf = { version = "3.7.2" } +protobuf = { workspace = true } libc = { version = "0.2.59", features = [ "extra_traits" ] } nix = "0.26.2" log = "0.4" @@ -33,7 +62,7 @@ tokio-vsock = { version = "0.7.0", optional = true } [build-dependencies] # lock home to avoid conflict with latest version home = "=0.5.9" -protobuf-codegen = "3.7.2" +protobuf-codegen = { workspace = true } [features] default = ["sync"] diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..092fbf2e --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,27 @@ +# Release Process + +This document describes the steps to release a new version of the crate or wasi-demo-app images. + +## Crate Release Process + +### Release Steps + +1. Bump package and dependency versions in: + * `./compiler/Cargo.toml`: Bump the package version as needed. + * `./ttrpc-codegen/Cargo.toml`: Bump the package version as needed. + * `./Cargo.toml`: Bump package version as needed. Then bump the workspace dependencies version to match the respective crates versions. +2. Commit the changes and get them merged in the repo. +2. Dry run the `cargo publish` command as follow + ```bash + cargo +nightly publish \ + -Z package-workspace \ + --dry-run \ + --locked \ + -p ttrpc \ + -p ttrpc-codegen \ + -p ttrpc-compiler + ``` +2. If the dry run succeeds, publish the crates that need publishing using `cargo publihs -p ` in the following order + 1. `ttrpc-compiler` + 2. `ttrpc-codegen` + 3. `ttrpc` \ No newline at end of file diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 8d947dd5..67b83be4 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -1,21 +1,21 @@ [package] name = "ttrpc-compiler" version = "0.7.0" -edition = "2018" -authors = ["The AntFin Kata Team "] -license = "Apache-2.0" +edition = { workspace = true } +license = { workspace = true } +authors = { workspace = true } +readme = "README.md" keywords = ["compiler", "ttrpc", "protobuf"] description = "ttRPC compiler for ttrpc" categories = ["network-programming"] repository = "https://github.com/containerd/ttrpc-rust/tree/master/compiler" homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler" -readme = "README.md" [dependencies] # lock home to avoid conflict with latest version home = "=0.5.9" -protobuf = "3.7.2" -protobuf-codegen = "3.7.2" +protobuf = { workspace = true } +protobuf-codegen = { workspace = true } prost = "0.8" prost-build = "0.8" prost-types = "0.8" diff --git a/example/Cargo.toml b/example/Cargo.toml index 50dbaf11..1bb96195 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -9,6 +9,7 @@ readme = "README.md" repository = "https://github.com/alipay/ttrpc-rust" homepage = "https://github.com/alipay/ttrpc-rust" description = "An example of ttrpc." +publish = false [dev-dependencies] protobuf = "3.7.2" diff --git a/example/protocols/mod.rs b/example/protocols/mod.rs index 7c7af6c8..ded83f71 100644 --- a/example/protocols/mod.rs +++ b/example/protocols/mod.rs @@ -2,5 +2,9 @@ // // SPDX-License-Identifier: Apache-2.0 // + +#[rustfmt::skip] pub mod asynchronous; + +#[rustfmt::skip] pub mod sync; diff --git a/ttrpc-codegen/Cargo.toml b/ttrpc-codegen/Cargo.toml index 046dd674..d248836f 100644 --- a/ttrpc-codegen/Cargo.toml +++ b/ttrpc-codegen/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "ttrpc-codegen" version = "0.5.0" -edition = "2018" -authors = ["The AntFin Kata Team "] -license = "Apache-2.0" +edition = { workspace = true } +authors = { workspace = true } +license = { workspace = true } keywords = ["codegen", "ttrpc", "protobuf"] description = "Rust codegen for ttrpc using ttrpc-compiler crate" categories = ["network-programming", "development-tools::build-utils"] @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] # lock home to avoid conflict with latest version home = "=0.5.9" -protobuf-support = "3.7.2" -protobuf = "3.7.2" -protobuf-codegen = "3.7.2" -ttrpc-compiler = { version = "0.7.0", path = "../compiler" } +protobuf-support = { workspace = true } +protobuf = { workspace = true } +protobuf-codegen = { workspace = true } +ttrpc-compiler = { workspace = true }