Skip to content

Commit 105daa2

Browse files
committed
feat: publish stardocs on releases
1 parent 84f5644 commit 105daa2

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
7.4.0
1+
7.5.0
22
# The first line of this file is used by Bazelisk and Bazel to be sure
33
# the right version of Bazel is used to build and test this repo.
44
# This also defines which version is used on CI.

.bcr/source.template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"integrity": "**leave this alone**",
33
"strip_prefix": "{REPO}-{VERSION}",
4+
"docs_url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.docs.tar.gz",
45
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
56
}

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ on:
2020
type: string
2121
jobs:
2222
publish:
23-
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.2.1
23+
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v1.0.0
2424
with:
25-
tag_name: ${{ inputs.tag_name }}
25+
tag_name: ${{ inputs.tag_name || github.ref_name }}
2626
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
2727
registry_fork: aspect-build/bazel-central-registry
2828
draft: false

.github/workflows/release_prep.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ tar --file $ARCHIVE_TMP --append ${PREFIX}/tools/integrity.bzl
4040
gzip < $ARCHIVE_TMP > $ARCHIVE
4141
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
4242

43+
# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593
44+
docs="$(mktemp -d)"; targets="$(mktemp)"
45+
bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //py/...)'
46+
bazel --output_base="$docs" build --target_pattern_file="$targets"
47+
tar --create --auto-compress \
48+
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
49+
--file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" .
50+
4351
cat << EOF
4452
## Using [Bzlmod] with Bazel 6:
4553

0 commit comments

Comments
 (0)