Skip to content

Commit

Permalink
feat: automate publishing releases to Bazel Central Registry (#16014)
Browse files Browse the repository at this point in the history
Note, recent releases on the BCR have a patch set applied, and it seems these patches are developed independently to "fix" each protobuf release, rather than make changes to protobuf repo.

The effect of this PR will be to create a *broken* publish to BCR for each protobuf release. At least this red PR on BCR will be our indication that the patches need to be manually replayed there.

In parallel, starting with #16013 I'll apply as many of those patches to the protobuf repo as possible. That will reduce the manual effort for each release.

Replaces #14565 which originated from my fork so the tests wouldn't run.

Closes #16014

COPYBARA_INTEGRATE_REVIEW=#16014 from protocolbuffers:bcr e17d9c8
PiperOrigin-RevId: 615026796
  • Loading branch information
alexeagle authored and Copybara-Service committed Mar 12, 2024
1 parent ad5e55a commit d2b71b3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .bcr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Bazel Central Registry

When protobuf is released, we want it to be published to the Bazel Central
Registry automatically: <https://registry.bazel.build>

This folder contains configuration files to automate the publish step. See
<https://github.com/bazel-contrib/publish-to-bcr/blob/main/templates/README.md>
for authoritative documentation about these files.
23 changes: 23 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"homepage": "https://github.com/protocolbuffers/protobuf",
"maintainers": [
{
"email": "sandyzhang@google.com",
"github": "zhangskz",
"name": "Sandy Zhang"
},
{
"email": "mkruskal@google.com",
"github": "mkruskal-google",
"name": "Mike Kruskal"
},
{
"email": "gberg@google.com",
"github": "googleberg",
"name": "Jerry Berg"
}
],
"repository": ["github:protocolbuffers/protobuf"],
"versions": [],
"yanked_versions": {}
}
25 changes: 25 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
matrix:
platform: ["debian10", "macos", "ubuntu2004", "windows"]

tasks:
verify_targets:
name: "Verify build targets"
platform: ${{ platform }}
build_targets:
- '@protobuf//:protobuf'
- '@protobuf//:protobuf_lite'
- '@protobuf//:protoc'
- '@protobuf//:test_messages_proto2_cc_proto'
- '@protobuf//:test_messages_proto3_cc_proto'

bcr_test_module:
module_path: "examples"
matrix:

platform: ["debian10", "macos", "ubuntu2004", "windows"]
tasks:
run_test_module:
name: "Run test module"
platform: ${{ platform }}
build_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{VERSION}.zip"
}

0 comments on commit d2b71b3

Please sign in to comment.