Skip to content

Commit 1448e6e

Browse files
authored
chore: switch to upstream release workflow (#553)
This includes provenance attestations for our rust binaries and the release artifact Note, I've already disabled the Publish to BCR GH App for this repo, and added the BCR_PUBLISH_TOKEN as an org-wide secret
1 parent 9bb17cf commit 1448e6e

File tree

2 files changed

+52
-25
lines changed

2 files changed

+52
-25
lines changed

.github/workflows/publish.yaml

+34
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

+18-25
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
name: Release
55

66
on:
7-
workflow_dispatch: # allow trigger through Web UI
87
push:
98
tags:
109
- "v*.*.*"
11-
10+
permissions:
11+
id-token: write
12+
attestations: write
13+
contents: write
1214
jobs:
1315
build:
1416
# We don't attempt to cross-compile rust binaries from one OS to another.
@@ -40,26 +42,17 @@ jobs:
4042

4143
release:
4244
needs: build
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
# Fetch the built artifacts from build jobs above and extract into
48-
# ${GITHUB_WORKSPACE}/artifacts-macos-latest/*
49-
# ${GITHUB_WORKSPACE}/artifacts-ubuntu-latest/*
50-
- uses: actions/download-artifact@v4
51-
52-
- name: Prepare release
53-
run: .github/workflows/release_prep.sh > release_notes.txt
54-
55-
- name: Release
56-
uses: softprops/action-gh-release@v2
57-
with:
58-
prerelease: false
59-
# Use GH feature to populate the changelog automatically
60-
generate_release_notes: true
61-
body_path: release_notes.txt
62-
files: |
63-
artifacts-*/*
64-
rules_py-*.tar.gz
65-
fail_on_unmatched_files: true
45+
uses: bazel-contrib/.github/.github/workflows/[email protected]
46+
with:
47+
prerelease: false
48+
release_files: |
49+
artifacts-*/*
50+
rules_py-*.tar.gz
51+
tag_name: ${{ github.ref_name }}
52+
publish:
53+
needs: release
54+
uses: ./.github/workflows/publish.yaml
55+
with:
56+
tag_name: ${{ github.ref_name }}
57+
secrets:
58+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)