|
|
||
|---|---|---|
| .. | ||
| template | ||
| publish-to-bcr.sh | ||
| publish-to-bcr_test.sh | ||
| README.md | ||
BCR Publisher
This document explains how to use the publish-to-bcr.sh script to publish googleapis to the Bazel Central Registry (BCR).
Usage
The publish-to-bcr.sh script is used to automate the process of creating a new version of the googleapis module in the BCR.
Arguments
The script accepts the following arguments:
-r,--ref: (Required) The git ref (commit SHA, tag, or branch) ofgoogleapisto be published.-t,--templates_ref: The git ref to use for the templates. Defaults to the value of--ref.-o,--org: The GitHub organization. Defaults togoogleapis.-p,--protobuf_version: The version of protobuf to use. Defaults to21.7.-b,--bcr_organization: The GitHub organization for the Bazel Central Registry. Defaults tobazelbuild.-f,--bcr_folder: The local path to a fork of thebazel-central-registryrepository. If not provided, the script will clone it fromhttps://github.com/{bcr_organization}/bazel-central-registry.
Example
./publish-to-bcr.sh --ref <your-commit-sha>
After running the script
After the script is executed, it will perform the following actions:
- A new branch will be created in your local fork of
bazel-central-registry. - The script will prompt you to create a Pull Request. If you agree, a new PR will be created in the
bazelbuild/bazel-central-registryrepository. - The script will automatically add a comment to the PR with the content:
@bazel-io skip_check unstable_url. This is necessary to bypass the URL stability check.
Once the Pull Request has been created and all Continuous Integration (CI) checks are passing, a maintainer of the Bazel Central Registry will review and merge it.
Note on re-running the script
During development, you may need to run the script several times. Between each call, it's strongly recommended to reset your local fork of bazel-central-registry. For this, you can run the following command:
pushd "${fork_location}"
git reset --hard
git checkout main
git clean -d -f
popd
Testing
To run the unit tests for the script, use the following command:
./publish-to-bcr_test.sh