Skip to content

Commit 7a20ad5

Browse files
committed
chore: publish attestations to BCR
1 parent 74adfa9 commit 7a20ad5

File tree

3 files changed

+51
-34
lines changed

3 files changed

+51
-34
lines changed

.bcr/config.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.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.publish_token || secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release.yaml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,21 @@ on:
77
push:
88
tags:
99
- 'v*.*.*'
10-
10+
permissions:
11+
id-token: write
12+
attestations: write
13+
contents: write
1114
jobs:
12-
build:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
- name: Mount bazel caches
18-
uses: actions/cache@v4
19-
with:
20-
path: |
21-
"~/.cache/bazel"
22-
"~/.cache/bazel-repo"
23-
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
24-
restore-keys: bazel-cache-
25-
- name: bazel test //...
26-
env:
27-
# Bazelisk will download bazel to here
28-
XDG_CACHE_HOME: ~/.cache/bazel-repo
29-
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
30-
- name: Prepare release
31-
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
32-
- name: Release
33-
uses: softprops/action-gh-release@v1
34-
with:
35-
prerelease: true
36-
# Use GH feature to populate the changelog automatically
37-
generate_release_notes: true
38-
body_path: release_notes.txt
39-
files: rules_webpack-*.tar.gz
40-
fail_on_unmatched_files: true
15+
release:
16+
uses: bazel-contrib/.github/.github/workflows/[email protected]
17+
with:
18+
release_files: rules_webpack-*.tar.gz
19+
prerelease: false
20+
tag_name: ${{ github.ref_name }}
21+
publish:
22+
needs: release
23+
uses: ./.github/workflows/publish.yaml
24+
with:
25+
tag_name: ${{ github.ref_name }}
26+
secrets:
27+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)