Add publish --dry_run to the cargo_test

Add trivial README.md files for this to pass.

This will catch some but not all issues with the crates that would cause them to be rejected by crates.io

PiperOrigin-RevId: 702766719
pull/19516/head
Protobuf Team Bot 3 months ago committed by Copybara-Service
parent fbffeb5e04
commit 926f87d7cf
  1. 4
      rust/release_crates/README.md
  2. 10
      rust/release_crates/cargo_test.sh
  3. 1
      rust/release_crates/protobuf/BUILD
  4. 1
      rust/release_crates/protobuf/README.md
  5. 1
      rust/release_crates/protobuf_codegen/BUILD
  6. 2
      rust/release_crates/protobuf_codegen/README.md
  7. 2
      rust/release_crates/protobuf_example/README.md

@ -0,0 +1,4 @@
This directory contains one directory per crate that we release.
Each directory contains a pkg_tar() which packages up the crate into a tar which
can be pushed to crates.io.

@ -1,5 +1,7 @@
#!/bin/bash
# Runs tests that are defined in the protobuf crate using Cargo.
# Runs tests that are defined in the protobuf crate using Cargo. This also
# performs a publish dry-run, which catches some but not all issues that
# would prevent the crates from being published.
# This is not a hermetic task because Cargo will fetch the needed
# dependencies from crates.io
@ -59,9 +61,15 @@ tar -xvf $EXAMPLE_TAR -C $EXAMPLE_ROOT
cd $CRATE_ROOT
# Run all tests except doctests
CARGO_HOME=$CARGO_HOME cargo test --lib --bins --tests
CARGO_HOME=$CARGO_HOME cargo publish --dry-run
cd $CODEGEN_ROOT
CARGO_HOME=$CARGO_HOME cargo test --lib --bins --tests
CARGO_HOME=$CARGO_HOME cargo publish --dry-run
cd $EXAMPLE_ROOT
CARGO_HOME=$CARGO_HOME cargo test
# TODO: Cannot enable this dry-run yet because it checks that the versions of
# its dependencies are published on crates.io, which they are definitely not
# in this case.
# CARGO_HOME=$CARGO_HOME cargo publish --dry-run

@ -29,6 +29,7 @@ genrule(
filegroup(
name = "srcs",
srcs = [
"README.md",
"build.rs",
":gen_cargo_toml",
],

@ -0,0 +1 @@
The runtime of the official Google Rust Protobuf implementation.

@ -29,6 +29,7 @@ genrule(
filegroup(
name = "srcs",
srcs = [
"README.md",
":gen_cargo_toml",
] + glob(["src/**/*"]),
visibility = ["//rust:__subpackages__"],

@ -0,0 +1,2 @@
The build time dependency crate for generating code for the Google Rust Protobuf
implementation.

@ -0,0 +1,2 @@
An example that demonstrates how to use the `protobuf` and `protobuf_codegen`
crates together.
Loading…
Cancel
Save