Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ jobs:
aspect-api-token: ${{ secrets.ASPECT_API_TOKEN }}
- name: Gazelle
run: aspect gazelle --task-key=gazelle
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: aspect-build/setup-aspect@c22a8f64fb38f82f59ce809cd7eb9f8ae096da44 # v2026.23.2
with:
aspect-api-token: ${{ secrets.ASPECT_API_TOKEN }}
- name: Build API docs
run: bash .github/workflows/release_docs.sh "$RUNNER_TEMP/rules_py-docs.tar.gz"
test:
name: test (${{ matrix.workspace.path }}, ${{ matrix.bazel.id }})
runs-on: ${{ matrix.workspace.runner }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release_docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env bash
# Add generated API docs to the release
# see https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/stardoc.md
# Build the generated API docs archive attached to each release, see
# https://github.com/bazelbuild/bazel-central-registry/blob/main/docs/stardoc.md
set -o errexit -o nounset -o pipefail

docs="$(mktemp -d)"
targets="$(mktemp)"
out=$1
bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //...)'
bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //py/... + //uv/...)'
if [ ! -s "$targets" ]; then
echo "ERROR: no starlark_doc_extract targets found; the release docs archive would be empty" >&2
exit 1
fi
bazel --output_base="$docs" build --target_pattern_file="$targets"
tar --create --auto-compress \
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ gzip < $ARCHIVE_TMP > $ARCHIVE
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')

# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593
# Note, we use xargs here because the repo is on Bazel 7.4 which doesn't have the --output_file flag to bazel query
docs="$(mktemp -d)"
bazel --output_base="$docs" query --output=label 'kind("starlark_doc_extract rule", //py/...)' | xargs bazel --output_base="$docs" build
tar --create --auto-compress \
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
--file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" .
"$(dirname "$0")/release_docs.sh" "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz"

cat << EOF
Add to your \`MODULE.bazel\` file:
Expand Down
Loading