Skip to content

Commit b8de826

Browse files
committed
chore: publish stardocs on releases
1 parent 6a25e5b commit b8de826

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.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}/bazel-lib-{TAG}.tar.gz"
56
}

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
type: string
2222
jobs:
2323
publish:
24-
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected].2
24+
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected].3
2525
with:
2626
tag_name: ${{ inputs.tag_name }}
2727
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.

.github/workflows/release_prep.sh

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

46+
# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593
47+
docs="$(mktemp -d)"
48+
bazel --output_base="$docs" query --output=label 'kind("starlark_doc_extract rule", //...)' \
49+
| xargs bazel --output_base="$docs" build --remote_download_regex='.*doc_extract\.binaryproto'
50+
tar --create --auto-compress \
51+
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
52+
--file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" .
53+
4654
cat <<EOF
4755
4856
## Using Bzlmod with Bazel 6:

0 commit comments

Comments
 (0)