8000 chore: publish attestations to BCR (#2194) · aspect-build/rules_js@de34ef9 · GitHub
[go: up one dir, main page]

Skip to content

Commit de34ef9

Browse files
authored
chore: publish attestations to BCR (#2194)
1 parent 8987d08 commit de34ef9

File tree

2 files changed

+51
-33
lines changed

2 files changed

+51
-33
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/publish.yaml@v0.0.4
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: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,25 @@
11
# Cut a release whenever a new tag is pushed to the repo.
2-
# You should use an annotated tag, like `git tag -a v1.2.3`
3-
# and put the release notes into the commit message for the tag.
42
name: Release
53

64
on:
75
push:
86
tags:
97
- 'v*.*.*'
10-
8+
permissions:
9+
id-token: write
10+
attestations: write
11+
contents: write
1112
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-
# Cache the --dist_cache and --repository_cache directories (see ci.bazelrc)
21-
# and the default bazel output (https://bazel.build/remote/output-directories#layout)
22-
# and bazelisk cache.
23-
path: |
24-
~/.cache/bazel-disk-cache
25-
~/.cache/bazel-repository-cache
26-
~/.cache/bazel
27-
~/.cache/bazelisk
28-
key: bazel-cache-release-${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel', '**/*.js', '!e2e') }}
29-
restore-keys: bazel-cache-release-
30-
- name: bazel test //...
31-
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
32-
- name: Prepare release
33-
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
34-
- name: Release
35 9F51 -
uses: softprops/action-gh-release@v2
36-
with:
37-
# Use GH feature to populate the changelog automatically
38-
generate_release_notes: true
39-
body_path: release_notes.txt
40-
files: rules_js-*.tar.gz
41-
fail_on_unmatched_files: true
13+
release:
14+
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.2
15+
with:
16+
release_files: rules_js-*.tar.gz
17+
prerelease: false
18+
tag_name: ${{ github.ref_name }}
19+
publish:
20+
needs: release
21+
uses: ./.github/workflows/publish.yaml
22+
with:
23+
tag_name: ${{ github.ref_name }}
24+
secrets:
25+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)
0