Skip to content

Commit 05bd047

Browse files
authored
Merge pull request #294 from jprendes/workspace
Add a workspace
2 parents 871dcfb + 318b8ee commit 05bd047

File tree

6 files changed

+81
-20
lines changed

6 files changed

+81
-20
lines changed

Cargo.toml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
[package]
2-
name = "ttrpc"
3-
version = "0.8.4"
4-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
1+
[workspace]
2+
members = [
3+
"./compiler",
4+
"./ttrpc-codegen",
5+
"./example",
6+
"./"
7+
]
8+
resolver = "2"
9+
10+
[workspace.package]
511
edition = "2018"
612
license = "Apache-2.0"
7-
keywords = ["ttrpc", "protobuf", "rpc"]
813
readme = "README.md"
914
repository = "https://github.com/containerd/ttrpc-rust"
1015
homepage = "https://github.com/containerd/ttrpc-rust"
16+
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
17+
18+
[workspace.dependencies]
19+
# The dependencies in this section can be used by the crates in this
20+
# workspace by specifying `workspace = true` instead of the crate
21+
# version. For example, for protobuf:
22+
# protobuf = { workspace = true }
23+
ttrpc = { version = "0.8.4", path = "./" }
24+
ttrpc-codegen = { version = "0.5.0", path = "./ttrpc-codegen" }
25+
ttrpc-compiler = { version = "0.7.0", path = "./compiler" }
26+
protobuf = "3.7.2"
27+
protobuf-codegen = "3.7.2"
28+
protobuf-support = "3.7.2"
29+
30+
[package]
31+
name = "ttrpc"
32+
version = "0.8.4"
33+
authors = { workspace = true }
34+
edition = { workspace = true }
35+
license = { workspace = true }
36+
repository = { workspace = true }
37+
homepage = { workspace = true }
38+
keywords = ["ttrpc", "protobuf", "rpc"]
39+
readme = "README.md"
1140
description = "A Rust version of ttrpc."
1241
rust-version = "1.70"
1342

1443
[dependencies]
15-
protobuf = { version = "3.7.2" }
44+
protobuf = { workspace = true }
1645
libc = { version = "0.2.59", features = [ "extra_traits" ] }
1746
nix = "0.26.2"
1847
log = "0.4"
@@ -33,7 +62,7 @@ tokio-vsock = { version = "0.7.0", optional = true }
3362
[build-dependencies]
3463
# lock home to avoid conflict with latest version
3564
home = "=0.5.9"
36-
protobuf-codegen = "3.7.2"
65+
protobuf-codegen = { workspace = true }
3766

3867
[features]
3968
default = ["sync"]

RELEASE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release Process
2+
3+
This document describes the steps to release a new version of the crate or wasi-demo-app images.
4+
5+
## Crate Release Process
6+
7+
### Release Steps
8+
9+
1. Bump package and dependency versions in:
10+
* `./compiler/Cargo.toml`: Bump the package version as needed.
11+
* `./ttrpc-codegen/Cargo.toml`: Bump the package version as needed.
12+
* `./Cargo.toml`: Bump package version as needed. Then bump the workspace dependencies version to match the respective crates versions.
13+
2. Commit the changes and get them merged in the repo.
14+
2. Dry run the `cargo publish` command as follow
15+
```bash
16+
cargo +nightly publish \
17+
-Z package-workspace \
18+
--dry-run \
19+
--locked \
20+
-p ttrpc \
21+
-p ttrpc-codegen \
22+
-p ttrpc-compiler
23+
```
24+
2. If the dry run succeeds, publish the crates that need publishing using `cargo publihs -p <crate>` in the following order
25+
1. `ttrpc-compiler`
26+
2. `ttrpc-codegen`
27+
3. `ttrpc`

compiler/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[package]
22
name = "ttrpc-compiler"
33
version = "0.7.0"
4-
edition = "2018"
5-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
6-
license = "Apache-2.0"
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
authors = { workspace = true }
7+
readme = "README.md"
78
keywords = ["compiler", "ttrpc", "protobuf"]
89
description = "ttRPC compiler for ttrpc"
910
categories = ["network-programming"]
1011
repository = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
1112
homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
12-
readme = "README.md"
1313

1414
[dependencies]
1515
# lock home to avoid conflict with latest version
1616
home = "=0.5.9"
17-
protobuf = "3.7.2"
18-
protobuf-codegen = "3.7.2"
17+
protobuf = { workspace = true }
18+
protobuf-codegen = { workspace = true }
1919
prost = "0.8"
2020
prost-build = "0.8"
2121
prost-types = "0.8"

example/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
repository = "https://github.com/alipay/ttrpc-rust"
1010
homepage = "https://github.com/alipay/ttrpc-rust"
1111
description = "An example of ttrpc."
12+
publish = false
1213

1314
[dev-dependencies]
1415
protobuf = "3.7.2"

example/protocols/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44
//
5+
6+
#[rustfmt::skip]
57
pub mod asynchronous;
8+
9+
#[rustfmt::skip]
610
pub mod sync;

ttrpc-codegen/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "ttrpc-codegen"
33
version = "0.5.0"
4-
edition = "2018"
5-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
6-
license = "Apache-2.0"
4+
edition = { workspace = true }
5+
authors = { workspace = true }
6+
license = { workspace = true }
77
keywords = ["codegen", "ttrpc", "protobuf"]
88
description = "Rust codegen for ttrpc using ttrpc-compiler crate"
99
categories = ["network-programming", "development-tools::build-utils"]
@@ -15,7 +15,7 @@ readme = "README.md"
1515
[dependencies]
1616
# lock home to avoid conflict with latest version
1717
home = "=0.5.9"
18-
protobuf-support = "3.7.2"
19-
protobuf = "3.7.2"
20-
protobuf-codegen = "3.7.2"
21-
ttrpc-compiler = { version = "0.7.0", path = "../compiler" }
18+
protobuf-support = { workspace = true }
19+
protobuf = { workspace = true }
20+
protobuf-codegen = { workspace = true }
21+
ttrpc-compiler = { workspace = true }

0 commit comments

Comments
 (0)