Skip to content

Commit b27d589

Browse files
authored
chore: publish stardoc with releases (#82)
Avoids a clumsy workflow of checking in the generated files. These will appear soon on registry.bazel.build.
1 parent 59dd7ac commit b27d589

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
type: string
2121
jobs:
2222
publish:
23-
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected].1
23+
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected].3
2424
with:
2525
tag_name: ${{ inputs.tag_name }}
2626
# 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
@@ -15,6 +15,14 @@ ARCHIVE="bazelrc-preset.bzl-$TAG.tar.gz"
1515
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
1616
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
1717

18+
# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593
19+
docs="$(mktemp -d)"; targets="$(mktemp)"
20+
bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //...)'
21+
bazel --output_base="$docs" build --target_pattern_file="$targets" --remote_download_regex='.*doc_extract\.binaryproto'
22+
tar --create --auto-compress \
23+
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
24+
--file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" .
25+
1826
cat << EOF
1927
Add to your \`MODULE.bazel\` file:
2028

0 commit comments

Comments
 (0)