Skip to content

Add the publish-to-bcr workflow, .bazelci config#370

Open
mbland wants to merge 2 commits intobazelbuild:mainfrom
mbland:mbland-publish-to-bcr
Open

Add the publish-to-bcr workflow, .bazelci config#370
mbland wants to merge 2 commits intobazelbuild:mainfrom
mbland:mbland-publish-to-bcr

Conversation

@mbland
Copy link

@mbland mbland commented Mar 13, 2026

Continues @Wyverald's work from #313 to prepare for publishing to the Bazel Central Registry. Adapted some of the new workflows from bazel-contrib/rules_scala v7.2.4.

  • Adjusted some of the dependency versions in MODULE.bazel to be as low as possible, compatible with Bazel 7.x, and high enough to avoid warnings.

  • Adds the test/bcr Bazel module for the .bcr/presubmit.yml tests, to test building targets referenced from a client repo.

  • Adds a .bazelci/presubmit.yml, which also mirrors the jobs from .bcr/presubmit.yml (but with a soft_fail).

  • Adds release.yml and release_prep.sh to .github/workflows as well, which are prerequisites for the publish-to-bcr.yml workflow.

  • Updates several generated Go files after running hooks/pre-commit.

The module builds with Bazel 7.x, 8.x, and 9.x (8.x and 9.x require --incompatible_autoload_externally, as noted in .bazelrc). It will not currently build with rolling (10.0.0-pre.20260223.3) and last_green (bazelbuild/bazel@6a70e55) Bazels. Neither have --incompatible_autoload_externally any longer, and the unreleased grpc v1.80.0 contains the fix.

Fixes #369.

Closes #313.

Continue's @Wyverald's work from bazelbuild#313 to prepare for publishing to the
Bazel Central Registry. Adapted some of the new workflows from
bazel-contrib/rules_scala v7.2.4.

- Adjusted some of the dependency versions in MODULE.bazel to be as low
  as possible, compatible with Bazel 7.x, and high enough to avoid
  warnings.

- Adds the `test/bcr` Bazel module for the `.bcr/presubmit.yml` tests,
  to test building targets referenced from a client repo.

- Adds a `.bazelci/presubmit.yml`, which also mirrors the jobs from
  `.bcr/presubmit.yml` (but with a `soft_fail`).

- Adds `release.yml` and `release_prep.sh` to `.github/workflows` as
  well, which are prerequisites for the `publish-to-bcr.yml` workflow.

- Updates several generated Go files after running `hooks/pre-commit`.

The module builds with Bazel 7.x, 8.x, and 9.x (8.x and 9.x require
`--incompatible_autoload_externally`, as noted in `.bazelrc`). It will
_not_ currently build with `rolling` (10.0.0-pre.20260223.3) and
`last_green` (bazelbuild/bazel@6a70e55)
Bazels. Neither have `--incompatible_autoload_externally` any longer,
and the unreleased `grpc` v1.80.0 contains the fix.

Fixes bazelbuild#369.

Closes bazelbuild#313.

Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
@mbland
Copy link
Author

mbland commented Mar 13, 2026

cc: @bergsieker

@mbland mbland mentioned this pull request Mar 13, 2026
@mbland
Copy link
Author

mbland commented Mar 17, 2026

cc: @meteorcloudy

"homepage": "https://github.com/bazelbuild/remote-apis",
"maintainers": [
{
"name": "Xudong Yang",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should @tjgq be a maintainer instead of @Wyverald ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in da70a40.

@tjgq are you OK with being the maintainer?

Per @meteorcloudy's suggestion below. Replaces @Wyverald, as well as
@bergsieker, who I understand isn't at Google anymore.

- bazelbuild#370 (comment)
@@ -0,0 +1,15 @@
{
"homepage": "https://github.com/bazelbuild/remote-apis",
"maintainers": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should @fmeum @sluongng also be in this list?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. 😉 @fmeum @sluongng would you be OK with that?

id-token: write
secrets:
# Necessary to push to the BCR fork and open a pull request.
publish_token: ${{ secrets.bcr_publish_token }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this secret defined?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be an existing org-level secret, given existing use by: https://github.com/bazelbuild/rules_java/blob/9.6.1/.github/workflows/publish.yaml#L30-L32

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.

Publishing to the Bazel Central Registry

3 participants