From 0813796e4288556f1ef8f15c2b2f24976278fcaf Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 12 Feb 2024 18:08:39 -0500 Subject: [PATCH] fixup rust publishing (#223) * fixup rust publishing Signed-off-by: William Woodruff * remove a spurious cargo exec Signed-off-by: William Woodruff --------- Signed-off-by: William Woodruff --- .github/workflows/rust-release.yml | 4 +++- Makefile | 1 - gen/pb-rust/Cargo.lock | 18 +++++++++--------- gen/pb-rust/Cargo.toml | 2 +- gen/pb-rust/derive/Cargo.toml | 13 ------------- .../sigstore-protobuf-specs-derive/Cargo.toml | 18 ++++++++++++++++++ .../src/lib.rs | 0 gen/pb-rust/sigstore-protobuf-specs/Cargo.toml | 3 +-- gen/pb-rust/sigstore-protobuf-specs/build.rs | 2 +- 9 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 gen/pb-rust/derive/Cargo.toml create mode 100644 gen/pb-rust/sigstore-protobuf-specs-derive/Cargo.toml rename gen/pb-rust/{derive => sigstore-protobuf-specs-derive}/src/lib.rs (100%) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 88eba827..a7e7ed69 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -28,6 +28,8 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - run: make rust RUST_ACTION=publish + - run: | + cd gen/pb-rust + cargo publish -p sigstore_protobuf_specs env: CARGO_REGISTRY_TOKEN: "${{ secrets.CARGO_REGISTRY_TOKEN }}" diff --git a/Makefile b/Makefile index 11ff54a0..fcf68d5c 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,6 @@ jsonschema: docker-image-jsonschema -c "cd defs/gen/jsonschema && ./jsonschema.sh -I ../../protos -I /googleapis/ --jsonschema_out=schemas ../../protos/*.proto" rust: docker-image - @echo "Running `cargo ${RUST_ACTION}`" docker run \ --platform linux/amd64 \ -v ${PWD}:/defs \ diff --git a/gen/pb-rust/Cargo.lock b/gen/pb-rust/Cargo.lock index 21cabb7b..d73a1e59 100644 --- a/gen/pb-rust/Cargo.lock +++ b/gen/pb-rust/Cargo.lock @@ -47,14 +47,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "derive" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "either" version = "1.10.0" @@ -412,12 +404,19 @@ dependencies = [ "serde", ] +[[package]] +name = "sigstore-protobuf-specs-derive" +version = "0.0.1" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "sigstore_protobuf_specs" version = "0.3.0" dependencies = [ "anyhow", - "derive", "glob", "prost", "prost-build", @@ -426,6 +425,7 @@ dependencies = [ "prost-types", "serde", "serde_json", + "sigstore-protobuf-specs-derive", "which 6.0.0", ] diff --git a/gen/pb-rust/Cargo.toml b/gen/pb-rust/Cargo.toml index 2400777c..08fc933f 100644 --- a/gen/pb-rust/Cargo.toml +++ b/gen/pb-rust/Cargo.toml @@ -2,5 +2,5 @@ resolver = "2" members = [ "sigstore-protobuf-specs", - "derive" + "sigstore-protobuf-specs-derive" ] diff --git a/gen/pb-rust/derive/Cargo.toml b/gen/pb-rust/derive/Cargo.toml deleted file mode 100644 index 4b7214a9..00000000 --- a/gen/pb-rust/derive/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "derive" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -syn = "2.0" -quote = "1.0" - -[lib] -proc-macro = true diff --git a/gen/pb-rust/sigstore-protobuf-specs-derive/Cargo.toml b/gen/pb-rust/sigstore-protobuf-specs-derive/Cargo.toml new file mode 100644 index 00000000..987f56f4 --- /dev/null +++ b/gen/pb-rust/sigstore-protobuf-specs-derive/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sigstore-protobuf-specs-derive" +version = "0.0.1" +edition = "2021" +authors = ["Sigstore Authors "] +homepage = "https://github.com/sigstore/protobuf-specs" +repository = "https://github.com/sigstore/protobuf-specs" +description = "Derive macros for sigstore-protobuf-specs. This is an implementation detail, you do not need this dependency." +readme = "README.md" +license-file = "LICENSE" +keywords = ["sigstore"] + +[dependencies] +syn = "2.0" +quote = "1.0" + +[lib] +proc-macro = true diff --git a/gen/pb-rust/derive/src/lib.rs b/gen/pb-rust/sigstore-protobuf-specs-derive/src/lib.rs similarity index 100% rename from gen/pb-rust/derive/src/lib.rs rename to gen/pb-rust/sigstore-protobuf-specs-derive/src/lib.rs diff --git a/gen/pb-rust/sigstore-protobuf-specs/Cargo.toml b/gen/pb-rust/sigstore-protobuf-specs/Cargo.toml index 1b242727..ac40fdb7 100644 --- a/gen/pb-rust/sigstore-protobuf-specs/Cargo.toml +++ b/gen/pb-rust/sigstore-protobuf-specs/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "sigstore_protobuf_specs" version = "0.3.0" -exclude = ["codegen/"] authors = ["Sigstore Authors "] edition = "2021" homepage = "https://github.com/sigstore/protobuf-specs" @@ -18,7 +17,7 @@ prost = "0.12.3" prost-reflect = { version = "0.12.0", features = ["serde", "derive"] } serde = {version = "1.0", features = ["derive"]} serde_json = "1.0" -derive = { path = "../derive" } +sigstore-protobuf-specs-derive = { version = "0.0.1", path = "../sigstore-protobuf-specs-derive" } [build-dependencies] anyhow = "1.0.72" diff --git a/gen/pb-rust/sigstore-protobuf-specs/build.rs b/gen/pb-rust/sigstore-protobuf-specs/build.rs index 7f68a907..d864bb08 100644 --- a/gen/pb-rust/sigstore-protobuf-specs/build.rs +++ b/gen/pb-rust/sigstore-protobuf-specs/build.rs @@ -23,7 +23,7 @@ fn main() -> anyhow::Result<()> { .include_file("mod.rs") .type_attribute( ".", - "#[derive(derive::Deserialize_proto, derive::Serialize_proto)]", + "#[derive(sigstore_protobuf_specs_derive::Deserialize_proto, sigstore_protobuf_specs_derive::Serialize_proto)]", ) // Disable problematic comments interpreted as doctests. .disable_comments([".io.intoto.Envelope"]);