Bazel Central Registry Publishing Configuration
This directory contains the configuration files for publishing brotli modules to the Bazel Central Registry (BCR).
Modules
This repository publishes two modules to BCR:
- brotli (root) - The main Brotli C library
- brotli_go (go/) - Go bindings for Brotli
Each module has its own set of template files under .bcr and .bcr/go respectively.
Files
Root module (brotli)
- metadata.template.json: Metadata about the brotli module including homepage, maintainers, and repository location
- source.template.json: Template for generating source archive URLs for releases
- presubmit.yml: BCR CI configuration that defines build and test tasks to validate the module
Go module (brotli_go)
- go/metadata.template.json: Metadata for the brotli_go module
- go/source.template.json: Source configuration with path to the go subdirectory
- go/presubmit.yml: BCR CI configuration for the Go module
Shared
- config.yml: Configuration specifying both modules via moduleRoots
- README.md: This file
Setup (One-time)
Before you can publish to BCR, you need to set up the following:
Fork the Bazel Central Registry
Create a Personal Access Token
- Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
- Click “Generate new token (classic)”
- Select scopes:
repo and workflow - Generate the token and copy it
Add the token to repository secrets
- Go to the brotli repository Settings > Secrets and variables > Actions
- Click “New repository secret”
- Name:
BCR_PUBLISH_TOKEN - Value: Paste the token from step 2
- Click “Add secret”
Publishing Process
To publish new versions of both modules to BCR:
- Create a GitHub release with a tag (e.g.,
v1.2.1) - Go to the Actions tab in GitHub
- Select the “Publish to BCR” workflow
- Click “Run workflow”
- Enter the release tag name (e.g.,
v1.2.1) - Enter your BCR fork (e.g.,
yourusername/bazel-central-registry) - Click “Run workflow”
The workflow will automatically create pull requests to the Bazel Central Registry for both modules.
References