Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .bcr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Configuration to use Publish to BCR

This directory contains a set of templates required by the [publish-to-bcr](https://github.com/bazel-contrib/publish-to-bcr/tree/main) plugin, which will publish a released version of **gRPC-Gateway** as a new module in the [Bazel Central Registry](https://registry.bazel.build/).

The plugin aims to eliminate a manual publishing process for the module and initiate the process when a release is created.

## Publish to BCR template files

The configuration consists of three files placed in the `.bcr` directory:

* `.bcr/metadata.template.json`: that describes the repository and maintainers' information.
* `.bcr/presubmit.yml`: describes the targets that will be built and tested on specific platforms and bazel versions to test the module.
* `.bcr/source.template.json`: that will automatically substitute values for the repository, owner, and tag based on the repository and release data.

_For more information regarding the files that form a BCR entry, check the following references:_

* [Bazel registries](https://bazel.build/external/registry).
* [External dependencies overview](https://bazel.build/external/overview).

## Result

The final result of this process is the creation of a PR in the BCR repository to publish the released version.

Once these templates are populated, the `publish-to-bcr` app should be configured as described [here](https://github.com/bazel-contrib/publish-to-bcr/tree/main?tab=readme-ov-file#how-it-works).
13 changes: 13 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"homepage": "https://grpc-ecosystem.github.io/grpc-gateway",
"maintainers": [
{
"name": "Johan Brandhorst-Satzkorn",
"email": "[email protected]",
"github": "johanbrandhorst"
}
],
"repository": ["github:grpc-ecosystem/grpc-gateway"],
"versions": [],
"yanked_versions": {}
}
14 changes: 14 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bcr_test_module:
module_path: "MODULE.bazel"
matrix:
platform: ["debian10", "macos", "ubuntu2004", "windows"]
bazel: [6.x, 7.x, 8.x]
tasks:
run_tests:
name: "Build and test grpc-gateway module"
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- "//..."
test_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": "",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
}
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
"postUpdateOptions": [
"gomodTidy"
],
"customManagers": [
{
"customType": "regex",
"fileMatch": [".bcr/presubmit.yml"],
"matchStrings": [
"bazel:\\s*\\[(?<currentValue>[0-9.x,\\s]+)\\]"
],
"depNameTemplate": "Bazel",
"datasourceTemplate": "bazel",
"versioningTemplate": "regex:^\\d+\\.x$"
}
],
"packageRules": [
{
"updateTypes": [
Expand Down
Loading