Skip to content

Commit bf77d17

Browse files
committed
chore: use publish to bcr reusable workflow for bcr mirroring
1 parent cdaf15f commit bf77d17

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

.bcr/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
fixedReleaser:
2-
login: scentini
3-
email: 11149636+scentini@users.noreply.github.com
41
moduleRoots:
52
- "."
63
- "extensions/bindgen"

.github/workflows/publish.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://github.com/bazel-contrib/publish-to-bcr
2+
name: Publish to BCR
3+
4+
on:
5+
# Allow the publish workflow to be called from another workflow.
6+
# In this case, we trigger it from the release.yaml workflow.
7+
workflow_call:
8+
inputs:
9+
release_version:
10+
required: true
11+
type: string
12+
secrets:
13+
BCR_PUBLISH_TOKEN:
14+
required: true
15+
# In case of problems, let release engineers retry by manually dispatching
16+
# the workflow from the GitHub UI.
17+
workflow_dispatch:
18+
inputs:
19+
release_version:
20+
required: true
21+
type: string
22+
description: Release version to publish to the Bazel Central Registry
23+
templates_ref:
24+
default: ''
25+
type: string
26+
description: Override the ref to read .bcr templates from
27+
jobs:
28+
publish:
29+
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v1.1.0
30+
with:
31+
attest: false
32+
tag_name: ${{ inputs.release_version }}
33+
# Tags don't include a "v" prefix
34+
tag_prefix: ""
35+
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
36+
registry_fork: scentini/bazel-central-registry
37+
templates_ref: ${{ inputs.templates_ref || inputs.tag_name }}
38+
permissions:
39+
contents: write
40+
secrets:
41+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,10 @@ jobs:
315315
asset_name: cargo-bazel-aarch64-unknown-linux-musl
316316
asset_path: ${{ github.workspace }}/artifacts/aarch64-unknown-linux-musl/cargo-bazel
317317
asset_content_type: application/octet-stream
318+
publish:
319+
needs: [archive, release]
320+
uses: ./.github/workflows/publish.yaml
321+
with:
322+
release_version: ${{ needs.archive.outputs.release_version }}
323+
secrets:
324+
BCR_PUBLISH_TOKEN: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)