Publish to BCR #3
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
| # 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: | |
| draft: false | |
| tag_name: ${{ inputs.tag_name }} | |
| # GitHub repository which is a fork of the upstream where the Pull Request will be opened. | |
| registry_fork: protocolbuffers/bazel-central-registry | |
| # Require pull request to be created manually in order to avoid using a classic PAT | |
| open_pull_request: false | |
| 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 }} |