Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ceb7364
add versions folder
alan707 Oct 31, 2025
627e367
typo
alan707 Oct 31, 2025
581d8a3
chore: update documentation from upstream Bazel repo
github-actions[bot] Oct 31, 2025
b1e448d
add versioned docs to the pipeline
alan707 Nov 2, 2025
103e73e
fix issue
alan707 Nov 2, 2025
d2d5779
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
bf7ac37
add missing step
alan707 Nov 2, 2025
cc2bbff
remove config docs
alan707 Nov 2, 2025
21db02b
pull from master for now
alan707 Nov 2, 2025
d49bc4f
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
96f83b1
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
d24b134
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
4adbf1b
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
c460315
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
68acc43
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
2595bff
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
65fd1bd
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
6738135
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
b12dc3b
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
afc3c8c
ignore broken files from version 5.4.1
alan707 Nov 2, 2025
fc0d481
fix workflow issues
alan707 Nov 2, 2025
9ecddce
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
7ffcac9
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
9335ee9
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
ccbc45e
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 2, 2025
2cef60d
update scripts
alan707 Nov 2, 2025
c5a0e0d
add a nightly version release workflow
alan707 Nov 3, 2025
60eb129
chore: update documentation from upstream Bazel repo
github-actions[bot] Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 24 additions & 28 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,38 @@ concurrency:
cancel-in-progress: false

jobs:
check-dependabot:
timeout-minutes: 5
if: >
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.base.ref == 'main'
get_info:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
outputs:
should_process: ${{ steps.check.outputs.should_process }}
commit_hash: ${{ steps.get_hash.outputs.commit_hash }}
update-type: ${{ steps.metadata.outputs.update-type }}
steps:
- name: Fetch Dependabot metadata
id: meta
uses: dependabot/fetch-metadata@v2
- name: Checkout repository
uses: actions/checkout@v5
with:
github-token: ${{ secrets.GH_AUTOMERGE_PAT }}

- name: Check if upstream submodule
id: check
run: |
if [[ "${{ steps.meta.outputs.package-ecosystem }}" == "submodules" ]] && \
[[ "${{ steps.meta.outputs.dependency-names }}" == *"upstream"* ]]; then
echo "should_process=true" >> $GITHUB_OUTPUT
else
echo "should_process=false" >> $GITHUB_OUTPUT
fi

# Generate docs after dependabot updates the submodule
submodules: true

- name: Get PR metadata
id: metadata
uses: dependabot/fetch-metadata@v2.4.0

- name: Get submodule commit hash
id: get_hash
working-directory: ./upstream
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

generate-docs:
needs: check-dependabot
if: needs.check-dependabot.outputs.should_process == 'true'
needs: get_info
if: github.actor == 'dependabot[bot]'
uses: ./.github/workflows/pull-from-bazel-build.yml
with:
bazelCommitHash: ${{ needs.get_info.outputs.commit_hash }}
secrets: inherit

# Auto-merge after docs are generated
enable-automerge:
needs: [check-dependabot, generate-docs]
if: needs.check-dependabot.outputs.should_process == 'true'
automerge:
if: github.actor == 'dependabot[bot]'
needs: generate-docs
runs-on: ubuntu-latest
steps:
- name: Enable auto-merge (squash)
Expand Down
181 changes: 181 additions & 0 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: Nightly Release Documentation Build

on:
schedule:
- cron: '0 0 * * *' # Run nightly at midnight
workflow_dispatch: # Allow manual runs

jobs:
setup:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.get_versions.outputs.versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Get versions
id: get_versions
run: echo "versions=$(jq -c . docs-versions.json)" >> $GITHUB_OUTPUT

nightly-release:
needs: setup
strategy:
matrix:
version: ${{ fromJson(needs.setup.outputs.versions) }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: false

- name: Checkout submodules
run: git submodule update --init -- upstream

- name: Checkout correct submodule version
working-directory: upstream
run: |
git fetch origin
if [ "${{ matrix.version }}" == "HEAD" ]; then
git checkout master
else
git checkout "${{ matrix.version }}"
fi

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
repository-cache: true

- name: Build reference documentation
id: build_ref_docs
working-directory: upstream
continue-on-error: true
run: >
bazel build
--config=docs
--build_metadata=ROLE=DOCS
--remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }}
--bes_results_url=https://app.buildbuddy.io/invocation/
--bes_backend=grpcs://remote.buildbuddy.io
--remote_cache=grpcs://remote.buildbuddy.io
--remote_timeout=10m
//src/main/java/com/google/devtools/build/lib:gen_reference_docs

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.2'

- name: Initialize Go module for converter
run: |
cd html2md_converter
go mod init html-to-md-converter
go get github.com/JohannesKaufmann/html-to-markdown

- name: Build HTML to Markdown converter
run: |
cd html2md_converter
go build -o html-to-md main.go

- name: Convert reference documentation HTML to Markdown
if: steps.build_ref_docs.outcome == 'success'
run: |
./html2md_converter/html-to-md \
-zip upstream/bazel-bin/src/main/java/com/google/devtools/build/lib/reference-docs.zip \
-output reference-docs-temp

- name: Handle failed reference doc build
if: steps.build_ref_docs.outcome != 'success'
run: |
echo "Warning: Could not build reference docs for ${{ matrix.version }}. Reference docs may be incomplete for this version."
rm -rf reference-docs-temp
mkdir -p reference-docs-temp

- name: Copy Docs
run: |
DEST_DIR="."
if [ "${{ matrix.version }}" != "HEAD" ]; then
DEST_DIR="versions/${{ matrix.version }}"
fi
echo "Copying docs to directory: $DEST_DIR"
./copy-upstream-docs.sh "$DEST_DIR"

- name: Upload generated docs as artifact
uses: actions/upload-artifact@v5
with:
name: docs-${{ matrix.version }}
path: |
./**/*.mdx
!./versions/
./versions/${{ matrix.version }}
retention-days: 1

publish:
needs: nightly-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.GH_AUTOMERGE_PAT }}

- name: Clean up old docs
run: |
# Remove all generated docs from the root, except for index.mdx and any other non-generated files.
find . -maxdepth 1 -name "*.mdx" -not -name "index.mdx" -delete
# Remove all old version directories
rm -rf versions

- name: Download all generated docs
uses: actions/download-artifact@v6

- name: Combine all docs
run: |
# The download action places each artifact in its own directory.
# We need to move them to the correct final locations.
find . -mindepth 2 -name "*.mdx" -exec mv {} . \;

- name: Create versioned navigation
run: ./docs.json.update.sh

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Create Pull Request with updated docs
env:
GH_TOKEN: ${{ secrets.GH_AUTOMERGE_PAT }}
run: |
set -euo pipefail

# Only proceed if there are changes
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes detected, skipping PR creation."
exit 0
fi

BRANCH_NAME="nightly-doc-update-$(date +%Y-%m-%d)"
git checkout -b "$BRANCH_NAME"

echo "Changes detected, committing and pushing to new branch..."
git add -A
git commit -m $'chore: nightly documentation update from upstream'
git push origin "$BRANCH_NAME" --force

echo "Creating Pull Request..."
gh pr create \
--title "Nightly Documentation Update" \
--body "Automated nightly update of documentation from the upstream Bazel repository." \
--base main \
--head "$BRANCH_NAME"

echo "Enabling auto-merge for the PR..."
gh pr merge --auto --squash "$BRANCH_NAME"
16 changes: 12 additions & 4 deletions .github/workflows/pull-from-bazel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ jobs:
- name: Checkout submodules
run: git submodule update --init -- upstream

- name: Get submodule commit hash
working-directory: upstream
run: git rev-parse HEAD

- name: Update submodule to latest master (if no specific commit is given)
if: ${{ inputs.bazelCommitHash == '' }}
working-directory: upstream
run: |
git fetch origin master
git checkout master

- name: Checkout commit of Bazel Build submodule
if: ${{ inputs.bazelCommitHash != '' }}
working-directory: upstream
Expand Down Expand Up @@ -88,11 +99,8 @@ jobs:
-zip upstream/bazel-bin/src/main/java/com/google/devtools/build/lib/reference-docs.zip \
-output reference-docs-temp

- name: Transform upstream docs to mdx
- name: Copy HEAD docs
run: ./copy-upstream-docs.sh

- name: Create versioned navigation
run: ./docs.json.update.sh

- name: Clean up temporary files
run: rm -rf reference-docs-temp
Expand Down
Loading
Loading