feat: automate publishing releases to Bazel Central Registry (#16014)

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 https://github.com/protocolbuffers/protobuf/pull/14565 which originated from my fork so the tests wouldn't run.

Closes #16014

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16014 from protocolbuffers:bcr e17d9c8127
PiperOrigin-RevId: 615026796
pull/16119/head
Alex Eagle 2024-03-12 07:01:58 -07:00 committed by Copybara-Service
parent ad5e55ab92
commit d2b71b347d
4 changed files with 61 additions and 0 deletions

8
.bcr/README.md Normal file
View File

@ -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.

View File

@ -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
.bcr/presubmit.yml Normal file
View File

@ -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:
- "//..."

View File

@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{VERSION}.zip"
}