-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add metadata and configuration templates for publishing to BCR #5455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hharrisd
wants to merge
10
commits into
grpc-ecosystem:main
Choose a base branch
from
hharrisd:configure-publish-to-bcr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
20cb9c1
Add metadata and configuration templates for publishing to BCR
hharrisd c34a36e
Point the homepage to the docs site
hharrisd 73a7968
Add a readme for the publish to BCR section
hharrisd edde27e
Add a configuration to keep the bezel version up to date
hharrisd 439d481
Merge branch 'grpc-ecosystem:main' into configure-publish-to-bcr
hharrisd bdc7747
Add the configuration to publish the module in BCR using GH Actions
hharrisd 7e8fc97
Update platform versions to test
hharrisd 93f2bec
Merge branch 'grpc-ecosystem:main' into configure-publish-to-bcr
hharrisd 5e5247f
Merge branch 'configure-publish-to-bcr' of github.com:hharrisd/grpc-g…
hharrisd 3e99ba6
Enable automerge for bazel-contrib/publish-to-bcr to keep the reusabl…
hharrisd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
bcr_test_module: | ||
module_path: "MODULE.bazel" | ||
matrix: | ||
platform: ["debian11", "macos", "macos_arm64", "ubuntu2404", "windows"] | ||
bazel: [6.x, 7.x, 8.x] | ||
johanbrandhorst marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tasks: | ||
run_tests: | ||
name: "Build and test grpc-gateway module" | ||
platform: ${{ platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "//..." | ||
test_targets: | ||
- "//..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Publish new releases to Bazel Central Registry. | ||
name: Publish to BCR | ||
on: | ||
# Run the publish workflow after a successful release | ||
# Will be triggered from the release.yaml workflow | ||
workflow_call: | ||
inputs: | ||
tag_name: | ||
required: true | ||
type: string | ||
secrets: | ||
publish_token: | ||
required: true | ||
# In case of problems, let release engineers retry by manually dispatching | ||
# the workflow from the GitHub UI | ||
workflow_dispatch: | ||
inputs: | ||
tag_name: | ||
description: git tag being released | ||
required: true | ||
type: string | ||
jobs: | ||
publish: | ||
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected] | ||
with: | ||
tag_name: ${{ inputs.tag_name }} | ||
# GitHub repository which is a fork of the upstream where the Pull Request will be opened. | ||
registry_fork: grpc-ecosystem/bazel-central-registry | ||
permissions: | ||
attestations: write | ||
contents: write | ||
id-token: write | ||
secrets: | ||
# Necessary to push to the BCR fork, and to open a pull request against a registry | ||
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }} | ||
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I take it I need to create these tokens? Where can I get one? Why are there two? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.