From b13e44fb19a11d414798be933ac7d57d88401d29 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Feb 2026 18:08:29 +0000 Subject: [PATCH 01/23] chore: update master branch version to 'dev' for development docs --- conf.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/conf.py b/conf.py index 403d5b5ea4d..97edbde85de 100644 --- a/conf.py +++ b/conf.py @@ -59,13 +59,11 @@ # This makes it easier to test the custom 404 page by loading `/404.html` # on a local web server. if not on_rtd: - notfound_urls_prefix = '' + notfound_urls_prefix = "" # Specify the site name for the Open Graph extension. ogp_site_name = "Godot Engine documentation" -ogp_social_cards = { - "enable": False -} +ogp_social_cards = {"enable": False} if not os.getenv("SPHINX_NO_GDSCRIPT"): extensions.append("gdscript") @@ -84,9 +82,7 @@ # General information about the project project = "Godot Engine" -copyright = ( - "2024-present by the Redot community, modified from an original work by Juan Linietsky, Ariel Manzur and the G-dot community (CC BY 3.0)" -) +copyright = "2024-present by the Redot community, modified from an original work by Juan Linietsky, Ariel Manzur and the G-dot community (CC BY 3.0)" author = "the Redot community, modified from an original work by Juan Linietsky, Ariel Manzur and the G-dot community" # Version info for the project, acts as replacement for |version| and |release| @@ -177,7 +173,7 @@ "flyout_display": "attached", } -html_title = supported_languages[language] % ( "(" + version + ")" ) +html_title = supported_languages[language] % ("(" + version + ")") # Edit on GitHub options: https://docs.readthedocs.io/en/latest/guides/edit-source-links-sphinx.html html_context = { @@ -195,7 +191,7 @@ # Set this to `True` when in the `latest` branch to clearly indicate to the reader # that they are not reading the `stable` documentation. "godot_is_latest": True, - "godot_version": "4.4", + "godot_version": "dev", # Enables a banner that displays the up-to-date status of each article. "godot_show_article_status": True, # Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top. @@ -289,6 +285,7 @@ def godot_get_image_filename_for_language(filename, env): path = os.path.abspath(os.path.join("../images/", os.path.relpath(path, cwd))) return path + sphinx.util.i18n.get_image_filename_for_language = godot_get_image_filename_for_language # Similar story for the localized class reference, it's out of tree and there doesn't @@ -305,4 +302,4 @@ def godot_get_image_filename_for_language(filename, env): os.symlink("../classes/" + language, "classes") # Needed so the table of contents is created for EPUB -epub_tocscope = 'includehidden' +epub_tocscope = "includehidden" From 0dec59c95a266487bebe83efbd8a62248814460a Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Feb 2026 18:37:38 +0000 Subject: [PATCH 02/23] feat: build and deploy multiple doc versions (4.3, 4.4, dev) - Add BUILD_DIR environment variable to build.sh for versioned output - Update workflow to build stable (4.3), 4.4, and dev branches - Deploy all versions to Cloudflare Pages - Add stable -> 4.4 and latest -> dev redirects - Enable deployment from feature/versioning-setup branch for testing --- .github/workflows/build-and-deploy.yml | 71 ++++++++++++++++++++++---- build.sh | 17 ++++-- 2 files changed, 76 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index a92092409d1..742ef764032 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -5,6 +5,7 @@ on: branches: - master - optimize-build-simplify + - feature/versioning-setup pull_request: branches: - master @@ -49,12 +50,67 @@ jobs: doctrees-${{ github.ref }}- doctrees- - - name: Build documentation + - name: Build documentation for version 4.3 (stable branch) run: | + git fetch origin stable:stable + git checkout stable export FULL_RUN=1 + export BUILD_DIR="4.3" bash build.sh env: FULL_RUN: 1 + BUILD_DIR: "4.3" + + - name: Build documentation for version 4.4 + run: | + git fetch origin 4.4:4.4 + git checkout 4.4 + export FULL_RUN=1 + export BUILD_DIR="4.4" + bash build.sh + env: + FULL_RUN: 1 + BUILD_DIR: "4.4" + + - name: Build documentation for dev (current branch) + run: | + git checkout ${{ github.ref_name }} + export FULL_RUN=1 + export BUILD_DIR="dev" + bash build.sh + env: + FULL_RUN: 1 + BUILD_DIR: "dev" + + - name: Create redirects + run: | + mkdir -p output/html/en + # Create stable redirect to 4.4 (latest stable) + cat > output/html/en/stable.html << 'EOF' + + + + + Redirecting to stable version + + +

Redirecting to stable version...

+ + + EOF + # Create latest redirect to dev + cat > output/html/en/latest.html << 'EOF' + + + + + Redirecting to latest version + + +

Redirecting to development version...

+ + + EOF - name: Upload build artifact uses: actions/upload-artifact@v4 @@ -66,7 +122,7 @@ jobs: deploy: needs: build runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/optimize-build-simplify') + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/optimize-build-simplify' || github.ref == 'refs/heads/feature/versioning-setup') steps: - name: Download build artifact @@ -75,17 +131,14 @@ jobs: name: redot-docs-build path: output/ - - name: Determine deploy directory + - name: List built versions run: | - if [ "${{ github.ref_name }}" = "master" ]; then - echo "DEPLOY_DIR=output/html/en/latest" >> $GITHUB_ENV - else - echo "DEPLOY_DIR=output/html/en/${{ github.ref_name }}" >> $GITHUB_ENV - fi + echo "Built versions:" + ls -la output/html/en/ - name: Deploy to Cloudflare Pages uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy ${{ env.DEPLOY_DIR }} --project-name=redot-docs --branch=${{ github.ref_name }} + command: pages deploy output/html/en --project-name=redot-docs --branch=${{ github.ref_name }} diff --git a/build.sh b/build.sh index 69cfe83574f..a8bbacb09a3 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,7 @@ # FULL_RUN - Set to enable full documentation build # CF_PAGES - Automatically set by Cloudflare Pages # CF_PAGES_BRANCH - Branch being built (set by Cloudflare Pages) +# BUILD_DIR - Override the output directory name (e.g., "4.3", "4.4", "dev") set -e # Exit on error @@ -28,9 +29,19 @@ fi # Map branches to output directories # master -> latest, everything else -> branch name -buildDir="$gitBranch" -if [ "$gitBranch" = "master" ]; then - buildDir="latest" +# Allow BUILD_DIR override for versioned builds +if [ -n "$BUILD_DIR" ]; then + buildDir="$BUILD_DIR" +elif [ -n "$CF_PAGES" ]; then + buildDir="${CF_PAGES_BRANCH:-master}" + if [ "$buildDir" = "master" ]; then + buildDir="latest" + fi +else + buildDir="$gitBranch" + if [ "$buildDir" = "master" ]; then + buildDir="latest" + fi fi echo "========================================" From d0f36205a27abba6e03ac6a92e643116f19dc424 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Feb 2026 19:21:41 +0000 Subject: [PATCH 03/23] fix: fetch all branches in workflow to enable multi-version builds Add fetch-depth: 0 to actions/checkout to ensure stable and 4.4 branches are available for building versioned documentation. --- .github/workflows/build-and-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 742ef764032..226d86e0527 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -22,6 +22,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches for multi-version builds - name: Set up Python uses: actions/setup-python@v5 From a7d0c0a6fed889a56626ec9bbd839d7f057d5320 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Feb 2026 20:25:29 +0000 Subject: [PATCH 04/23] fix: checkout remote tracking branches directly Remove git fetch commands and checkout origin/stable and origin/4.4 directly since fetch-depth: 0 already brings all branches. --- .github/workflows/build-and-deploy.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 226d86e0527..0d355744102 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -54,8 +54,7 @@ jobs: - name: Build documentation for version 4.3 (stable branch) run: | - git fetch origin stable:stable - git checkout stable + git checkout origin/stable export FULL_RUN=1 export BUILD_DIR="4.3" bash build.sh @@ -65,8 +64,7 @@ jobs: - name: Build documentation for version 4.4 run: | - git fetch origin 4.4:4.4 - git checkout 4.4 + git checkout origin/4.4 export FULL_RUN=1 export BUILD_DIR="4.4" bash build.sh From 4aad0904d3a2cb9ca1f245155b787652e069adf1 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Feb 2026 23:24:27 +0000 Subject: [PATCH 05/23] fix: fetch version branches from upstream remote Add upstream remote and fetch stable/4.4 branches from Redot-Engine/redot-docs instead of relying on origin which may not have these branches in forks. --- .github/workflows/build-and-deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 0d355744102..5a640330445 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -54,7 +54,9 @@ jobs: - name: Build documentation for version 4.3 (stable branch) run: | - git checkout origin/stable + git remote add upstream https://github.com/Redot-Engine/redot-docs.git || true + git fetch upstream stable + git checkout upstream/stable export FULL_RUN=1 export BUILD_DIR="4.3" bash build.sh @@ -64,7 +66,9 @@ jobs: - name: Build documentation for version 4.4 run: | - git checkout origin/4.4 + git remote add upstream https://github.com/Redot-Engine/redot-docs.git || true + git fetch upstream 4.4 + git checkout upstream/4.4 export FULL_RUN=1 export BUILD_DIR="4.4" bash build.sh From 020643323386034240bd1b6a84137f783d387300 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 00:54:38 +0000 Subject: [PATCH 06/23] fix: add root index.html to prevent 404 errors Add index.html at root level that redirects to stable (4.4) version. Cloudflare Pages needs an index.html at the deploy root. --- .github/workflows/build-and-deploy.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 5a640330445..d3eab748a05 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -89,6 +89,19 @@ jobs: - name: Create redirects run: | mkdir -p output/html/en + # Create root index.html that redirects to stable + cat > output/html/en/index.html << 'EOF' + + + + + Redot Documentation + + +

Redirecting to stable documentation...

+ + + EOF # Create stable redirect to 4.4 (latest stable) cat > output/html/en/stable.html << 'EOF' From 1e1a886eafc3843e734a4c5df77fe54e359e7a1c Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 00:58:12 +0000 Subject: [PATCH 07/23] feat: parallel builds for multiple documentation versions Use GitHub Actions matrix strategy to build 4.3, 4.4, and dev versions in parallel. Each version builds independently, then artifacts are combined in deploy job. Should reduce total build time from ~72 minutes to ~25 minutes (lengthiest single build). --- .github/workflows/build-and-deploy.yml | 94 +++++++++++++------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index d3eab748a05..434a7f7e991 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -18,12 +18,21 @@ jobs: build: runs-on: ubuntu-latest timeout-minutes: 120 + strategy: + matrix: + include: + - version: "4.3" + branch: "upstream/stable" + - version: "4.4" + branch: "upstream/4.4" + - version: "dev" + branch: "current" steps: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 # Fetch all branches for multi-version builds + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 @@ -41,50 +50,58 @@ jobs: id: cache-migrated with: path: _migrated - key: migrated-${{ hashFiles('**/*.rst', 'conf.py', 'migrate.py') }} + key: migrated-${{ matrix.version }}-${{ hashFiles('**/*.rst', 'conf.py', 'migrate.py') }} - name: Cache Sphinx doctrees uses: actions/cache@v4 with: path: _sphinx/.doctrees - key: doctrees-${{ github.ref }}-${{ github.run_id }} + key: doctrees-${{ matrix.version }}-${{ github.run_id }} restore-keys: | - doctrees-${{ github.ref }}- + doctrees-${{ matrix.version }}- doctrees- - - name: Build documentation for version 4.3 (stable branch) + - name: Build documentation for ${{ matrix.version }} run: | - git remote add upstream https://github.com/Redot-Engine/redot-docs.git || true - git fetch upstream stable - git checkout upstream/stable + if [ "${{ matrix.branch }}" != "current" ]; then + git remote add upstream https://github.com/Redot-Engine/redot-docs.git 2>/dev/null || true + git fetch upstream + git checkout ${{ matrix.branch }} + fi export FULL_RUN=1 - export BUILD_DIR="4.3" + export BUILD_DIR="${{ matrix.version }}" bash build.sh env: FULL_RUN: 1 - BUILD_DIR: "4.3" + BUILD_DIR: ${{ matrix.version }} - - name: Build documentation for version 4.4 - run: | - git remote add upstream https://github.com/Redot-Engine/redot-docs.git || true - git fetch upstream 4.4 - git checkout upstream/4.4 - export FULL_RUN=1 - export BUILD_DIR="4.4" - bash build.sh - env: - FULL_RUN: 1 - BUILD_DIR: "4.4" + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: docs-${{ matrix.version }} + path: output/html/en/${{ matrix.version }} + retention-days: 1 + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/optimize-build-simplify' || github.ref == 'refs/heads/feature/versioning-setup') + + steps: + - name: Download all build artifacts + uses: actions/download-artifact@v4 + with: + path: output/html/en/ + pattern: docs-* + merge-multiple: false - - name: Build documentation for dev (current branch) + - name: Organize artifacts run: | - git checkout ${{ github.ref_name }} - export FULL_RUN=1 - export BUILD_DIR="dev" - bash build.sh - env: - FULL_RUN: 1 - BUILD_DIR: "dev" + # Move artifacts from docs-X directories to version directories + for dir in output/html/en/docs-*; do + version=$(basename "$dir" | sed 's/docs-//') + mv "$dir" "output/html/en/$version" + done - name: Create redirects run: | @@ -129,25 +146,6 @@ jobs: EOF - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: redot-docs-build - path: output/ - retention-days: 1 - - deploy: - needs: build - runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/optimize-build-simplify' || github.ref == 'refs/heads/feature/versioning-setup') - - steps: - - name: Download build artifact - uses: actions/download-artifact@v4 - with: - name: redot-docs-build - path: output/ - - name: List built versions run: | echo "Built versions:" From 88e9ed9ac77be17a34a455010db9a3a824688801 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 01:39:29 +0000 Subject: [PATCH 08/23] fix: use absolute paths in redirects to prevent redirect loops Change relative URLs (4.4/, dev/) to absolute paths (/4.4/, /dev/) to prevent infinite redirect loops when accessing versioned docs. --- .github/workflows/build-and-deploy.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 434a7f7e991..a58d0a8d2bf 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -111,11 +111,11 @@ jobs: - + Redot Documentation -

Redirecting to stable documentation...

+

Redirecting to stable documentation...

EOF @@ -124,11 +124,11 @@ jobs: - + Redirecting to stable version -

Redirecting to stable version...

+

Redirecting to stable version...

EOF @@ -137,11 +137,11 @@ jobs: - + Redirecting to latest version -

Redirecting to development version...

+

Redirecting to development version...

EOF From ee5951f952d544a123a7753c6efad8ab7d838a16 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 01:42:48 +0000 Subject: [PATCH 09/23] fix: use updated build.sh when building upstream branches Save build.sh from current branch before checking out upstream/stable or upstream/4.4, then restore it after checkout. This ensures we use the BUILD_DIR-aware build script even when building older branches that don't have this feature. --- .github/workflows/build-and-deploy.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index a58d0a8d2bf..7541989e167 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -63,10 +63,16 @@ jobs: - name: Build documentation for ${{ matrix.version }} run: | + # Save our updated build.sh that supports BUILD_DIR + cp build.sh /tmp/build-with-versions.sh + chmod +x /tmp/build-with-versions.sh + if [ "${{ matrix.branch }}" != "current" ]; then git remote add upstream https://github.com/Redot-Engine/redot-docs.git 2>/dev/null || true git fetch upstream git checkout ${{ matrix.branch }} + # Restore our updated build.sh (upstream branches don't have BUILD_DIR support) + cp /tmp/build-with-versions.sh build.sh fi export FULL_RUN=1 export BUILD_DIR="${{ matrix.version }}" From 276ead1f169736001f694d8a3da7885bb3d7bf21 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 02:16:34 +0000 Subject: [PATCH 10/23] feat: add version selector with actual Redot versions (4.3, 4.4, 26.1, dev) - Add godot_versions list to html_context in conf.py - Update versions.html template to use godot_versions instead of hardcoded stable/latest - Show actual version numbers (4.3, 4.4, 26.1, dev, stable, latest) in dropdown --- _templates/versions.html | 4 ++-- conf.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/_templates/versions.html b/_templates/versions.html index 7adccecf2a0..3926eff321b 100644 --- a/_templates/versions.html +++ b/_templates/versions.html @@ -1,7 +1,7 @@ {# Add rst-badge after rst-versions for small badge style. #} -{% set display_version = version -%} +{% set display_version = godot_version -%} {% set listed_languages = ({"en":"#", "de":"#", "es":"#", "fr":"#"}).items() -%} -{% set listed_versions = ({"stable":"#", "latest":"#"}).items() -%} +{% set listed_versions = godot_versions -%} {% if READTHEDOCS and current_version %} {% set display_version = current_version -%} diff --git a/conf.py b/conf.py index 97edbde85de..f1c9dd6ebf1 100644 --- a/conf.py +++ b/conf.py @@ -183,7 +183,7 @@ "github_version": "master", # Version "conf_py_path": "/", # Path in the checkout to the docs root "godot_docs_title": supported_languages[language], - "godot_docs_basepath": "https://docs.godotengine.org/", + "godot_docs_basepath": "https://docs.redotengine.org/", "godot_docs_suffix": ".html", # Distinguish local development website from production website. # This prevents people from looking for changes on the production website after making local changes :) @@ -196,6 +196,15 @@ "godot_show_article_status": True, # Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top. "godot_show_article_comments": on_rtd and not is_i18n, + # Available documentation versions for the version selector + "godot_versions": [ + ("4.3", "/4.3/"), + ("4.4", "/4.4/"), + ("26.1", "/26.1/"), + ("dev", "/dev/"), + ("stable", "/stable/"), + ("latest", "/latest/"), + ], } html_logo = "img/docs_logo.svg" From fe0d4aab90c74114ffa07967c43b78bddb9f4075 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 02:44:18 +0000 Subject: [PATCH 11/23] debug: add verbose logging to build step to diagnose failures Add set -x and echo statements to see exactly what's happening when checking out upstream branches and running the build. This will help identify why builds are failing on upstream/stable and upstream/4.4. --- .github/workflows/build-and-deploy.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 7541989e167..db52713548d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -63,20 +63,31 @@ jobs: - name: Build documentation for ${{ matrix.version }} run: | - # Save our updated build.sh that supports BUILD_DIR + set -x # Enable debug mode + + # Save our updated build.sh and conf.py that support BUILD_DIR cp build.sh /tmp/build-with-versions.sh + cp conf.py /tmp/conf-with-versions.py chmod +x /tmp/build-with-versions.sh if [ "${{ matrix.branch }}" != "current" ]; then + echo "Setting up upstream remote..." git remote add upstream https://github.com/Redot-Engine/redot-docs.git 2>/dev/null || true + echo "Fetching upstream..." git fetch upstream + echo "Checking out ${{ matrix.branch }}..." git checkout ${{ matrix.branch }} - # Restore our updated build.sh (upstream branches don't have BUILD_DIR support) + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Current commit: $(git rev-parse HEAD)" + # Restore our updated build.sh and conf.py (upstream branches don't have BUILD_DIR support) cp /tmp/build-with-versions.sh build.sh + cp /tmp/conf-with-versions.py conf.py fi + + echo "Building with BUILD_DIR=${{ matrix.version }}" export FULL_RUN=1 export BUILD_DIR="${{ matrix.version }}" - bash build.sh + bash -x build.sh env: FULL_RUN: 1 BUILD_DIR: ${{ matrix.version }} From 3bbb03ac575b10dd0db780a7aeb789640764d4ca Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 02:47:32 +0000 Subject: [PATCH 12/23] fix: handle different migrate.py versions in upstream branches Check if migrate.py supports --exclude-classes flag before using it. Upstream branches (4.4, stable) have older migrate.py that doesn't support this flag, causing 'required arguments missing' error. --- build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a8bbacb09a3..2ab7ebba50f 100755 --- a/build.sh +++ b/build.sh @@ -70,7 +70,12 @@ if [ -n "$FULL_RUN" ]; then echo "[2/4] Migrating Godot to Redot (with --exclude-classes)..." rm -rf "$migrateDir" mkdir -p "$migrateDir" - python migrate.py --exclude-classes "$inputDir" "$migrateDir" + # Check if migrate.py supports --exclude-classes flag + if python migrate.py --help | grep -q "exclude-classes"; then + python migrate.py --exclude-classes "$inputDir" "$migrateDir" + else + python migrate.py "$inputDir" "$migrateDir" + fi fi echo "" From f86e841591563d19f4a81e5b3dc202c0be308ac2 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 02:50:59 +0000 Subject: [PATCH 13/23] fix: don't use --exclude-classes on upstream branches When gitBranch is HEAD (upstream checkout), we know we're on an old branch that doesn't support --exclude-classes flag. Use simple syntax for upstream branches and --exclude-classes only for our feature branch. --- build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2ab7ebba50f..2a25f7cc8b8 100755 --- a/build.sh +++ b/build.sh @@ -70,10 +70,13 @@ if [ -n "$FULL_RUN" ]; then echo "[2/4] Migrating Godot to Redot (with --exclude-classes)..." rm -rf "$migrateDir" mkdir -p "$migrateDir" - # Check if migrate.py supports --exclude-classes flag - if python migrate.py --help | grep -q "exclude-classes"; then + # Check if we're building from upstream branch (doesn't support --exclude-classes) + # by checking if BUILD_DIR is set (our feature branch sets it, upstream builds won't) + if [ -n "$BUILD_DIR" ] && [ "$gitBranch" != "HEAD" ]; then + # Our branch with new migrate.py - use --exclude-classes python migrate.py --exclude-classes "$inputDir" "$migrateDir" else + # Upstream branch - old migrate.py, don't use --exclude-classes python migrate.py "$inputDir" "$migrateDir" fi fi From daeda62913c86b81aaee4c48ae5738f94c9fe74e Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 02:53:56 +0000 Subject: [PATCH 14/23] chore: rename workflow job to show version only --- .github/workflows/build-and-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index db52713548d..116dc196f93 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -16,6 +16,7 @@ concurrency: jobs: build: + name: Build docs (${{ matrix.version }}) runs-on: ubuntu-latest timeout-minutes: 120 strategy: From 9b35947877bd65958690486124eec2ac3cb1aa18 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 03:49:11 +0000 Subject: [PATCH 15/23] simplify: show only 4.3, 4.4, and dev in version selector Remove stable, latest, and 26.1 from version list to simplify. Update root redirect to go directly to 4.4. Remove stable.html and latest.html redirects. --- .github/workflows/build-and-deploy.yml | 30 ++------------------------ conf.py | 3 --- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 116dc196f93..47f0b34602b 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -124,7 +124,7 @@ jobs: - name: Create redirects run: | mkdir -p output/html/en - # Create root index.html that redirects to stable + # Create root index.html that redirects to 4.4 (default version) cat > output/html/en/index.html << 'EOF' @@ -133,33 +133,7 @@ jobs: Redot Documentation -

Redirecting to stable documentation...

- - - EOF - # Create stable redirect to 4.4 (latest stable) - cat > output/html/en/stable.html << 'EOF' - - - - - Redirecting to stable version - - -

Redirecting to stable version...

- - - EOF - # Create latest redirect to dev - cat > output/html/en/latest.html << 'EOF' - - - - - Redirecting to latest version - - -

Redirecting to development version...

+

Redirecting to Redot 4.4 documentation...

EOF diff --git a/conf.py b/conf.py index f1c9dd6ebf1..67a51c8204e 100644 --- a/conf.py +++ b/conf.py @@ -200,10 +200,7 @@ "godot_versions": [ ("4.3", "/4.3/"), ("4.4", "/4.4/"), - ("26.1", "/26.1/"), ("dev", "/dev/"), - ("stable", "/stable/"), - ("latest", "/latest/"), ], } From 21b96189734726edfb25fe56d00b5e387acc1994 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 10:12:22 +0000 Subject: [PATCH 16/23] fix: don't overwrite conf.py on upstream branches Stop copying conf.py from feature branch to upstream branches. Each branch needs its own version settings: - 4.4 branch should show '4.4', not 'dev' - 4.3 branch should show '4.3' - Only feature branch shows 'dev' This fixes the issue where 4.4 docs were showing dev branding and warning banner. --- .github/workflows/build-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 47f0b34602b..0be5926cb46 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -80,9 +80,9 @@ jobs: git checkout ${{ matrix.branch }} echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" echo "Current commit: $(git rev-parse HEAD)" - # Restore our updated build.sh and conf.py (upstream branches don't have BUILD_DIR support) + # Restore only build.sh - keep upstream's conf.py for correct version settings cp /tmp/build-with-versions.sh build.sh - cp /tmp/conf-with-versions.py conf.py + # Do NOT copy conf.py - upstream branches have their own version settings fi echo "Building with BUILD_DIR=${{ matrix.version }}" From 5ce88117d747379926659aabc5d8974a7c06e37c Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 10:13:58 +0000 Subject: [PATCH 17/23] fix: add fallback for missing godot_versions and copy template - Add fallback in versions.html for branches without godot_versions defined - Copy updated versions.html template to upstream branches during build - This ensures all versions show the same version selector dropdown - 4.3 and 4.4 branches will now properly show version list even without godot_versions in conf.py --- .github/workflows/build-and-deploy.yml | 7 ++++--- _templates/versions.html | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 0be5926cb46..c6849177e1a 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -66,9 +66,9 @@ jobs: run: | set -x # Enable debug mode - # Save our updated build.sh and conf.py that support BUILD_DIR + # Save our updated build.sh and versions.html cp build.sh /tmp/build-with-versions.sh - cp conf.py /tmp/conf-with-versions.py + cp _templates/versions.html /tmp/versions-template.html chmod +x /tmp/build-with-versions.sh if [ "${{ matrix.branch }}" != "current" ]; then @@ -80,8 +80,9 @@ jobs: git checkout ${{ matrix.branch }} echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" echo "Current commit: $(git rev-parse HEAD)" - # Restore only build.sh - keep upstream's conf.py for correct version settings + # Restore build.sh and versions.html with proper version selector cp /tmp/build-with-versions.sh build.sh + cp /tmp/versions-template.html _templates/versions.html # Do NOT copy conf.py - upstream branches have their own version settings fi diff --git a/_templates/versions.html b/_templates/versions.html index 3926eff321b..727ded92297 100644 --- a/_templates/versions.html +++ b/_templates/versions.html @@ -1,7 +1,12 @@ {# Add rst-badge after rst-versions for small badge style. #} {% set display_version = godot_version -%} {% set listed_languages = ({"en":"#", "de":"#", "es":"#", "fr":"#"}).items() -%} -{% set listed_versions = godot_versions -%} +{% if godot_versions is defined %} + {% set listed_versions = godot_versions -%} +{% else %} + {# Fallback for branches that don't define godot_versions #} + {% set listed_versions = [("4.3", "/4.3/"), ("4.4", "/4.4/"), ("dev", "/dev/")] -%} +{% endif %} {% if READTHEDOCS and current_version %} {% set display_version = current_version -%} From 37bf5afbca928d62736f9656becfdd2b6d4a462e Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 20:26:08 +0000 Subject: [PATCH 18/23] Simplify workflow: Build only 26.1 and deploy to root - Single build job for 26.1 LTS - Deploy directly to root (no subdirectories) - Removed multi-version matrix for simplicity --- .github/workflows/build-and-deploy.yml | 97 ++++++-------------------- 1 file changed, 20 insertions(+), 77 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index c6849177e1a..7dc5fef9592 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -4,7 +4,7 @@ on: push: branches: - master - - optimize-build-simplify + - 26.1 - feature/versioning-setup pull_request: branches: @@ -16,18 +16,9 @@ concurrency: jobs: build: - name: Build docs (${{ matrix.version }}) + name: Build docs (26.1) runs-on: ubuntu-latest timeout-minutes: 120 - strategy: - matrix: - include: - - version: "4.3" - branch: "upstream/stable" - - version: "4.4" - branch: "upstream/4.4" - - version: "dev" - branch: "current" steps: - name: Checkout repository @@ -51,102 +42,54 @@ jobs: id: cache-migrated with: path: _migrated - key: migrated-${{ matrix.version }}-${{ hashFiles('**/*.rst', 'conf.py', 'migrate.py') }} + key: migrated-26.1-${{ hashFiles('**/*.rst', 'conf.py', 'migrate.py') }} - name: Cache Sphinx doctrees uses: actions/cache@v4 with: path: _sphinx/.doctrees - key: doctrees-${{ matrix.version }}-${{ github.run_id }} + key: doctrees-26.1-${{ github.run_id }} restore-keys: | - doctrees-${{ matrix.version }}- + doctrees-26.1- doctrees- - - name: Build documentation for ${{ matrix.version }} + - name: Build documentation for 26.1 run: | - set -x # Enable debug mode - - # Save our updated build.sh and versions.html - cp build.sh /tmp/build-with-versions.sh - cp _templates/versions.html /tmp/versions-template.html - chmod +x /tmp/build-with-versions.sh - - if [ "${{ matrix.branch }}" != "current" ]; then - echo "Setting up upstream remote..." - git remote add upstream https://github.com/Redot-Engine/redot-docs.git 2>/dev/null || true - echo "Fetching upstream..." - git fetch upstream - echo "Checking out ${{ matrix.branch }}..." - git checkout ${{ matrix.branch }} - echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" - echo "Current commit: $(git rev-parse HEAD)" - # Restore build.sh and versions.html with proper version selector - cp /tmp/build-with-versions.sh build.sh - cp /tmp/versions-template.html _templates/versions.html - # Do NOT copy conf.py - upstream branches have their own version settings - fi - - echo "Building with BUILD_DIR=${{ matrix.version }}" + # Build from current branch (26.1) export FULL_RUN=1 - export BUILD_DIR="${{ matrix.version }}" - bash -x build.sh + export BUILD_DIR="." + bash build.sh env: FULL_RUN: 1 - BUILD_DIR: ${{ matrix.version }} + BUILD_DIR: "." - name: Upload build artifact uses: actions/upload-artifact@v4 with: - name: docs-${{ matrix.version }} - path: output/html/en/${{ matrix.version }} + name: redot-docs-26.1 + path: output/html/en/. retention-days: 1 deploy: needs: build runs-on: ubuntu-latest - if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/optimize-build-simplify' || github.ref == 'refs/heads/feature/versioning-setup') + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/26.1' || github.ref == 'refs/heads/feature/versioning-setup') steps: - - name: Download all build artifacts + - name: Download build artifact uses: actions/download-artifact@v4 with: - path: output/html/en/ - pattern: docs-* - merge-multiple: false + name: redot-docs-26.1 + path: . - - name: Organize artifacts + - name: List built files run: | - # Move artifacts from docs-X directories to version directories - for dir in output/html/en/docs-*; do - version=$(basename "$dir" | sed 's/docs-//') - mv "$dir" "output/html/en/$version" - done - - - name: Create redirects - run: | - mkdir -p output/html/en - # Create root index.html that redirects to 4.4 (default version) - cat > output/html/en/index.html << 'EOF' - - - - - Redot Documentation - - -

Redirecting to Redot 4.4 documentation...

- - - EOF - - - name: List built versions - run: | - echo "Built versions:" - ls -la output/html/en/ + echo "Built files:" + ls -la - name: Deploy to Cloudflare Pages uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy output/html/en --project-name=redot-docs --branch=${{ github.ref_name }} + command: pages deploy . --project-name=redot-docs --branch=main From 185d6e3f3daa5b8bed0c1075f3961b4c03daae95 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 20:59:30 +0000 Subject: [PATCH 19/23] Fix: Use proper paths for artifact upload/download - Build to 26.1 directory - Copy files to dist folder for artifact - Deploy from downloaded artifact root --- .github/workflows/build-and-deploy.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 7dc5fef9592..ed211f8b18c 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -57,17 +57,22 @@ jobs: run: | # Build from current branch (26.1) export FULL_RUN=1 - export BUILD_DIR="." + export BUILD_DIR="26.1" bash build.sh env: FULL_RUN: 1 - BUILD_DIR: "." + BUILD_DIR: "26.1" + + - name: Copy build to root structure + run: | + mkdir -p ./dist + cp -r output/html/en/26.1/* ./dist/ - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: redot-docs-26.1 - path: output/html/en/. + path: ./dist retention-days: 1 deploy: From a1c86289326aa1b0c5721bc837945ec9959258ad Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 21:43:49 +0000 Subject: [PATCH 20/23] Fix: Explicitly checkout 26.1 branch for build Workflow was building from feature/versioning-setup branch instead of 26.1. Now explicitly fetches and checks out origin/26.1 before building. --- .github/workflows/build-and-deploy.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ed211f8b18c..722d9554374 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -26,6 +26,11 @@ jobs: with: fetch-depth: 0 + - name: Checkout 26.1 branch + run: | + git fetch origin 26.1 + git checkout origin/26.1 + - name: Set up Python uses: actions/setup-python@v5 with: @@ -53,9 +58,14 @@ jobs: doctrees-26.1- doctrees- + - name: Checkout 26.1 branch + run: | + git fetch origin 26.1 + git checkout origin/26.1 + - name: Build documentation for 26.1 run: | - # Build from current branch (26.1) + # Build from 26.1 branch export FULL_RUN=1 export BUILD_DIR="26.1" bash build.sh From bbd6d4e95ec2ea42c3673c6ea1c6896468ca4827 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 22:10:07 +0000 Subject: [PATCH 21/23] Fix: Save build.sh before checking out 26.1 branch The 26.1 branch has old build.sh without BUILD_DIR support. Now we save the updated build.sh to /tmp first, then use it after checking out 26.1 branch. This ensures BUILD_DIR works correctly. --- .github/workflows/build-and-deploy.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 722d9554374..bb361b1df45 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -26,8 +26,12 @@ jobs: with: fetch-depth: 0 - - name: Checkout 26.1 branch + - name: Save build script and checkout 26.1 run: | + # Save the updated build.sh from feature branch + cp build.sh /tmp/build-with-versions.sh + chmod +x /tmp/build-with-versions.sh + # Now checkout 26.1 branch git fetch origin 26.1 git checkout origin/26.1 @@ -58,17 +62,12 @@ jobs: doctrees-26.1- doctrees- - - name: Checkout 26.1 branch - run: | - git fetch origin 26.1 - git checkout origin/26.1 - - name: Build documentation for 26.1 run: | - # Build from 26.1 branch + # Use the saved build.sh which supports BUILD_DIR export FULL_RUN=1 export BUILD_DIR="26.1" - bash build.sh + /tmp/build-with-versions.sh env: FULL_RUN: 1 BUILD_DIR: "26.1" From 58640feb989ab47e70d39e46347556158383a6f5 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 22:50:24 +0000 Subject: [PATCH 22/23] Build 26.1 docs from master branch content - Checkout upstream/master (has MCP docs and latest content) - Use conf.py from origin/26.1 (shows version 26.1) - This gives us all master content labeled as 26.1 LTS --- .github/workflows/build-and-deploy.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index bb361b1df45..e58ae07aeca 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -26,14 +26,20 @@ jobs: with: fetch-depth: 0 - - name: Save build script and checkout 26.1 + - name: Save build script and checkout master with 26.1 config run: | # Save the updated build.sh from feature branch cp build.sh /tmp/build-with-versions.sh chmod +x /tmp/build-with-versions.sh - # Now checkout 26.1 branch + # Fetch 26.1 branch to get its config git fetch origin 26.1 - git checkout origin/26.1 + # Save 26.1 conf.py + git show origin/26.1:conf.py > /tmp/conf-26.1.py + # Now checkout master (has all latest docs including MCP) + git fetch upstream master + git checkout upstream/master + # Copy 26.1 conf.py to override master version + cp /tmp/conf-26.1.py conf.py - name: Set up Python uses: actions/setup-python@v5 From b8dba1a5ddc95dcd42be5fc55290f628719d6628 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Tue, 3 Feb 2026 23:04:55 +0000 Subject: [PATCH 23/23] Fix: Add upstream remote before fetching master --- .github/workflows/build-and-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index e58ae07aeca..afc02c37064 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -31,11 +31,13 @@ jobs: # Save the updated build.sh from feature branch cp build.sh /tmp/build-with-versions.sh chmod +x /tmp/build-with-versions.sh + # Add upstream remote + git remote add upstream https://github.com/Redot-Engine/redot-docs.git 2>/dev/null || true # Fetch 26.1 branch to get its config git fetch origin 26.1 # Save 26.1 conf.py git show origin/26.1:conf.py > /tmp/conf-26.1.py - # Now checkout master (has all latest docs including MCP) + # Now checkout master from upstream (has all latest docs including MCP) git fetch upstream master git checkout upstream/master # Copy 26.1 conf.py to override master version