Skip to content

chore: prepare barretenberg-rs for crates.io publishing#20496

Open
johnathan79717 wants to merge 3 commits intomerge-train/barretenbergfrom
jh/commit-generated-rust-files
Open

chore: prepare barretenberg-rs for crates.io publishing#20496
johnathan79717 wants to merge 3 commits intomerge-train/barretenbergfrom
jh/commit-generated-rust-files

Conversation

@johnathan79717
Copy link
Contributor

@johnathan79717 johnathan79717 commented Feb 13, 2026

Summary

  • Add include field to barretenberg-rs Cargo.toml so generated api.rs and generated_types.rs are included in the published crate, even though they remain gitignored
  • Add publish = false to the tests crate
  • Add publish-barretenberg-rs.yml workflow that auto-publishes to crates.io on non-prerelease GitHub releases (with manual workflow_dispatch fallback)

How it works

  1. Generated files stay gitignored — not committed to the repo
  2. The include field in Cargo.toml overrides .gitignore for cargo publish, so the files are packaged as long as they exist on disk
  3. The publish workflow downloads the bb binary from the matching release, runs yarn generate to create the Rust bindings, sets the crate version, and publishes
  4. Triggered automatically on full releases (nightlies/RCs/spartan are skipped via prerelease filter)

Test plan

  • cargo package --list --allow-dirty confirms src/api.rs and src/generated_types.rs are included
  • cargo publish --dry-run --allow-dirty --no-verify succeeds (14 files, 171KB)
  • Set BARRETENBERG_CRATES_IO_TOKEN secret in repo settings before first real publish

@ludamad
Copy link
Collaborator

ludamad commented Feb 13, 2026

I'm opposed to this. this is how people get messy PR diffs and end up having to ask if they're messing something up

Add `include` to Cargo.toml so that the generated api.rs and
generated_types.rs are included in the published crate package even
though they remain gitignored. This way the crate is self-contained
on crates.io without committing generated files to the repo.

Also add `publish = false` to the tests crate.
@johnathan79717 johnathan79717 force-pushed the jh/commit-generated-rust-files branch from b00d10e to e2ffe4a Compare February 13, 2026 17:21
@johnathan79717 johnathan79717 changed the title chore: commit generated Rust files for barretenberg-rs publishing chore: prepare barretenberg-rs for crates.io publishing Feb 13, 2026
@johnathan79717 johnathan79717 marked this pull request as draft February 13, 2026 17:22
Manual workflow_dispatch that downloads the bb binary from a GitHub
release, generates the Rust bindings, sets the crate version, and
publishes to crates.io.
@johnathan79717
Copy link
Contributor Author

johnathan79717 commented Feb 13, 2026

I'm opposed to this. this is how people get messy PR diffs and end up having to ask if they're messing something up

I uncommitted those files.

@johnathan79717 johnathan79717 marked this pull request as ready for review February 13, 2026 17:47
@johnathan79717 johnathan79717 removed the request for review from charlielye February 16, 2026 10:53
The workflow now triggers on `release: published` and skips
pre-releases (nightlies, RCs, spartan). Manual workflow_dispatch
is kept as a fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants