Skip to content

Commit 2af5701

Browse files
authored
chore: publish attestations to BCR (#65)
* chore: publish attestations to BCR Note, I've removed the Publish to BCR GH app from this repo. * Update publish.yaml
1 parent 19e0254 commit 2af5701

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Publish new releases to Bazel Central Registry.
2+
name: Publish
3+
on:
4+
# Run the publish workflow after a successful release
5+
# Will be triggered from the release.yaml workflow
6+
workflow_call:
7+
inputs:
8+
tag_name:
9+
required: true
10+
type: string
11+
secrets:
12+
publish_token:
13+
required: true
14+
# In case of problems, let release engineers retry by manually dispatching
15+
# the workflow from the GitHub UI
16+
workflow_dispatch:
17+
inputs:
18+
tag_name:
19+
required: true
20+
type: string
21+
jobs:
22+
publish:
23+
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected]
24+
with:
25+
tag_name: ${{ inputs.tag_name }}
26+
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
27+
registry_fork: aspect-build/bazel-central-registry
28+
permissions:
29+
attestations: write
30+
contents: write
31+
id-token: write
32+
secrets:
33+
# Necessary to push to the BCR fork, and to open a pull request against a registry
34+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,22 @@ on:
88
tags:
99
- "v*.*.*"
1010

11+
permissions:
12+
id-token: write
13+
attestations: write
14+
contents: write
15+
1116
jobs:
1217
release:
13-
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v6
18+
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.2
1419
with:
1520
release_files: toolchains_protoc-*.tar.gz
1621
prerelease: false
22+
tag_name: ${{ github.ref_name }}
23+
publish:
24+
needs: release
25+
uses: ./.github/workflows/publish.yaml
26+
with:
27+
tag_name: ${{ github.ref_name }}
28+
secrets:
29+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)