Skip to content
Open
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
18 changes: 14 additions & 4 deletions mintlify/check_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ if [[ "$(git config --get remote.origin.url)" == */bazel.git ]]; then
echo "--- :bazel::books: Building reference docs"
echo "Work dir: $(pwd)"

bazel --quiet build \
//src/main/java/com/google/devtools/build/lib:gen_mdx_reference_docs

ARCHIVE=bazel-bin/src/main/java/com/google/devtools/build/lib/mdx-reference-docs.zip
# gen_mdx_reference_docs was renamed to gen_reference_docs
# (https://github.com/bazelbuild/bazel/issues/31211).
# Support both names so that older commits and release branches still work.
LIB_PKG=src/main/java/com/google/devtools/build/lib
TARGET="//${LIB_PKG}:gen_reference_docs"
if ! grep -q 'name = "gen_reference_docs"' "${LIB_PKG}/BUILD"; then
TARGET="//${LIB_PKG}:gen_mdx_reference_docs"
fi

bazel --quiet build "$TARGET"

# Ask Bazel for the output name instead of hardcoding it, since the archive
# may be renamed too (mdx-reference-docs.zip -> reference-docs.zip).
ARCHIVE="bazel-bin/${LIB_PKG}/$(basename "$(bazel --quiet cquery --output=files "$TARGET")")"

buildkite-agent artifact upload "$ARCHIVE" || echo "--- [nonblocker] FYI: Docs upload failed"

Expand Down