chore: use publish to bcr reusable workflow for bcr mirroring (#3775)

Migrate rules_rust off of the deprecated Publish to BCR GitHub app to
the newer reusable workflow. The reusable workflow has a number of
benefits over the app:
* It supports build attestations which can be enabled at a later time.
* Gives finer grain control over running the publish process—if it
fails, you can manually re-run the workflow.
* It's more secure—you control the PAT rather than giving the app write
permissions.

Some actions that maintainer for this ruleset will need to take:
* [x] Add a classic PAT named `BCR_PUBLISH_TOKEN` for the repository or
org (see
[steps](https://github.com/bazel-contrib/publish-to-bcr?tab=readme-ov-file#setup)).
I recommend creating a "machine" user for bazelbuild and generating a
classic PAT for that user rather than using an individual's PAT. For
example, in bazel-contrib we use the
[bazel-contrib-bot](https://github.com/bazel-contrib-bot) user to do
publishes.
* [ ] Uninstall the GitHub app for this repo.
* [ ] Test a publish after landing, or wait for the next release. I'll
be available to help debug any issues that come up if the workflow
fails.

---------

Co-authored-by: UebelAndre <github@uebelandre.com>
3 files changed
tree: 1bd7d0ea615720402ec0b59ced30e62407374fb8
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. extensions/
  9. ffi/
  10. nix/
  11. rust/
  12. test/
  13. tools/
  14. util/
  15. .bazelignore
  16. .bazelrc
  17. .bazelversion
  18. .clang-format
  19. .clippy.toml
  20. .envrc
  21. .gitattributes
  22. .gitignore
  23. .pre-commit-config.yaml
  24. .prettierrc.toml
  25. .rustfmt.toml
  26. .typos.toml
  27. ARCHITECTURE.md
  28. AUTHORS
  29. BUILD.bazel
  30. CODEOWNERS
  31. COMPATIBILITY.md
  32. CONTRIBUTING.md
  33. CONTRIBUTORS
  34. LICENSE.txt
  35. MODULE.bazel
  36. README.md
  37. version.bzl
  38. WORKSPACE.bazel
  39. WORKSPACE.bzlmod
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Starter repo

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/rust.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.