Skip to content

Commit 4af1ac1

Browse files
authored
update crate workflow to support workspaces (#606)
* update crate workflow * Update build-crate.yml * drop unused deps * clarify versions and block publishing on other crates * Revert "drop unused deps" This reverts commit 7dd24da.
1 parent 245b500 commit 4af1ac1

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

.github/workflows/build-crate.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,31 @@ jobs:
2727
uses: dtolnay/rust-toolchain@stable
2828

2929
- name: fmt (stable)
30-
run: cargo +stable fmt -- --files-with-diff --check
30+
run: cargo +stable fmt --all -- --files-with-diff --check
31+
3132
- name: clippy (stable)
32-
run: cargo +stable clippy
33+
run: cargo clippy --workspace --all-features --all-targets -- -D warnings
34+
35+
- name: Install cargo-machete
36+
run: cargo install cargo-machete
37+
38+
- name: Unused dependencies
39+
run: cargo machete
40+
3341
- name: tests
34-
run: cargo test && cargo test --release
42+
run: cargo test --workspace --all-features && cargo test --workspace --all-features --release
43+
3544
- name: build
36-
run: cargo build --release
37-
- name: dry-run of `cargo publish`
38-
run: cargo publish --dry-run
45+
run: cargo build --workspace --all-features --release
46+
47+
- name: Install cargo-workspaces
48+
run: cargo install cargo-workspaces --locked
49+
50+
- name: Publish (dry run)
51+
run: cargo ws publish --publish-as-is --dry-run
3952

4053
- name: publish to crates.io if tagged
4154
if: startsWith(github.event.ref, 'refs/tags')
4255
env:
4356
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
44-
run: cargo publish
57+
run: cargo ws publish --publish-as-is

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["fuzz", "tools", "wasm", "wheel"]
2+
members = ["fuzz", "tools", "wasm", "wheel", "clvm-fuzzing"]
33

44
[package]
55
name = "clvmr"
@@ -38,8 +38,8 @@ openssl = ["chia-sha2/openssl"]
3838
lto = "thin"
3939

4040
[workspace.dependencies]
41-
clvmr = { path = "." }
42-
clvm-fuzzing = { path = "./clvm-fuzzing" }
41+
clvmr = { path = ".", version = "0.16.1" }
42+
clvm-fuzzing = { path = "./clvm-fuzzing", version = "0.16.1" }
4343
lazy_static = "1.5.0"
4444
num-bigint = "0.4.6"
4545
num-traits = "0.2.19"

tools/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description = "Developer tools for the CLVM interpreter"
88
homepage = "https://github.com/Chia-Network/clvm_rs/tools/"
99
repository = "https://github.com/Chia-Network/clvm_rs/tools/"
1010
readme = "README.md"
11+
publish = false
1112

1213
[dependencies]
1314
hex-literal = { workspace = true }

wasm/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description = "Implementation of `clvm` for Chia Network's cryptocurrency"
88
homepage = "https://github.com/Chia-Network/clvm_rs/"
99
repository = "https://github.com/Chia-Network/clvm_rs/"
1010
readme = "README.md"
11+
publish = false
1112

1213
[lib]
1314
name = "clvm_wasm"
@@ -20,3 +21,6 @@ wasm-bindgen = { workspace = true }
2021
wasm-bindgen-test = { workspace = true }
2122
js-sys = { workspace = true }
2223
getrandom = { workspace = true, features = ["js"] }
24+
25+
[package.metadata.cargo-machete]
26+
ignored = ["getrandom"]

wheel/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description = "Implementation of `clvm` for Chia Network's cryptocurrency"
88
homepage = "https://github.com/Chia-Network/clvm_rs/"
99
repository = "https://github.com/Chia-Network/clvm_rs/"
1010
readme = "../README.md"
11+
publish = false
1112

1213
[lib]
1314
name = "clvm_rs"

0 commit comments

Comments
 (0)