Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions barretenberg/rust/barretenberg-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ readme = "README.md"
# crates.io allows max 5 keywords
keywords = ["zero-knowledge", "snark", "plonk", "noir", "aztec"]
categories = ["cryptography", "api-bindings"]
# Include generated files in the published crate even though they're gitignored.
# They're generated by `yarn generate` in ts/ and must exist on disk before `cargo publish`.
include = ["src/**/*.rs", "build.rs", "README.md"]

[dependencies]
# Serialization
Expand Down
27 changes: 25 additions & 2 deletions barretenberg/rust/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ function test {
BB_LIB_DIR="$(cd ../cpp/build/lib && pwd)" RUSTFLAGS="-C link-arg=-Wl,--allow-multiple-definition" denoise "cargo test --release --features ffi"
}

function release {
echo_header "barretenberg-rs release"

local version=${REF_NAME#v}

# Set the workspace version to match the release tag
sed -i "s/^version = \".*\"/version = \"$version\"/" Cargo.toml

# Generated files must exist (created during build step)
if [ ! -f barretenberg-rs/src/api.rs ] || [ ! -f barretenberg-rs/src/generated_types.rs ]; then
echo "ERROR: generated files not found. Run 'cd ../ts && yarn generate' first."
exit 1
fi

# Publish to crates.io (--allow-dirty because version was just set and generated files are gitignored)
local extra_flags=""
if ! gh release view "v$version" --repo AztecProtocol/aztec-packages &>/dev/null; then
# No matching GitHub release yet — skip verification build (which would try to download libbb-external.a)
echo "No GitHub release found for v$version, adding --no-verify (pass REF_NAME matching a release for full verification)"
extra_flags="--no-verify"
fi
retry "denoise 'cargo publish --allow-dirty $extra_flags -p barretenberg-rs'"
}

function test_download {
echo_header "barretenberg-rs download test"

Expand Down Expand Up @@ -121,6 +145,5 @@ case "$cmd" in
$cmd
;;
*)
echo "Unknown command: $cmd"
exit 1
default_cmd_handler "$@"
esac
1 change: 1 addition & 0 deletions barretenberg/rust/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "barretenberg-tests"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
publish = false

[features]
ffi = ["barretenberg-rs/ffi"]
Expand Down
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ function release {
projects=(
barretenberg/cpp
barretenberg/ts
barretenberg/rust
noir
l1-contracts
noir-projects/aztec-nr
Expand Down
Loading