Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b13e44f
chore: update master branch version to 'dev' for development docs
MichaelFisher1997 Feb 2, 2026
0dec59c
feat: build and deploy multiple doc versions (4.3, 4.4, dev)
MichaelFisher1997 Feb 2, 2026
d0f3620
fix: fetch all branches in workflow to enable multi-version builds
MichaelFisher1997 Feb 2, 2026
a7d0c0a
fix: checkout remote tracking branches directly
MichaelFisher1997 Feb 2, 2026
4aad090
fix: fetch version branches from upstream remote
MichaelFisher1997 Feb 2, 2026
0206433
fix: add root index.html to prevent 404 errors
MichaelFisher1997 Feb 3, 2026
1e1a886
feat: parallel builds for multiple documentation versions
MichaelFisher1997 Feb 3, 2026
88e9ed9
fix: use absolute paths in redirects to prevent redirect loops
MichaelFisher1997 Feb 3, 2026
ee5951f
fix: use updated build.sh when building upstream branches
MichaelFisher1997 Feb 3, 2026
276ead1
feat: add version selector with actual Redot versions (4.3, 4.4, 26.1…
MichaelFisher1997 Feb 3, 2026
fe0d4aa
debug: add verbose logging to build step to diagnose failures
MichaelFisher1997 Feb 3, 2026
3bbb03a
fix: handle different migrate.py versions in upstream branches
MichaelFisher1997 Feb 3, 2026
f86e841
fix: don't use --exclude-classes on upstream branches
MichaelFisher1997 Feb 3, 2026
daeda62
chore: rename workflow job to show version only
MichaelFisher1997 Feb 3, 2026
9b35947
simplify: show only 4.3, 4.4, and dev in version selector
MichaelFisher1997 Feb 3, 2026
21b9618
fix: don't overwrite conf.py on upstream branches
MichaelFisher1997 Feb 3, 2026
5ce8811
fix: add fallback for missing godot_versions and copy template
MichaelFisher1997 Feb 3, 2026
37bf5af
Simplify workflow: Build only 26.1 and deploy to root
MichaelFisher1997 Feb 3, 2026
185d6e3
Fix: Use proper paths for artifact upload/download
MichaelFisher1997 Feb 3, 2026
a1c8628
Fix: Explicitly checkout 26.1 branch for build
MichaelFisher1997 Feb 3, 2026
bbd6d4e
Fix: Save build.sh before checking out 26.1 branch
MichaelFisher1997 Feb 3, 2026
58640fe
Build 26.1 docs from master branch content
MichaelFisher1997 Feb 3, 2026
b8dba1a
Fix: Add upstream remote before fetching master
MichaelFisher1997 Feb 3, 2026
50e335b
Merge branch 'master' into feature/versioning-setup
MichaelFisher1997 Feb 4, 2026
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
62 changes: 44 additions & 18 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- master
- optimize-build-simplify
- 26.1
- feature/versioning-setup
pull_request:
branches:
- master
Expand All @@ -15,12 +16,32 @@ concurrency:

jobs:
build:
name: Build docs (26.1)
runs-on: ubuntu-latest
timeout-minutes: 120

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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
# 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 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
cp /tmp/conf-26.1.py conf.py

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -38,54 +59,59 @@ jobs:
id: cache-migrated
with:
path: _migrated
key: migrated-${{ 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-${{ github.ref }}-${{ github.run_id }}
key: doctrees-26.1-${{ github.run_id }}
restore-keys: |
doctrees-${{ github.ref }}-
doctrees-26.1-
doctrees-

- name: Build documentation
- name: Build documentation for 26.1
run: |
# Use the saved build.sh which supports BUILD_DIR
export FULL_RUN=1
bash build.sh
export BUILD_DIR="26.1"
/tmp/build-with-versions.sh
env:
FULL_RUN: 1
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-build
path: output/
name: redot-docs-26.1
path: ./dist
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')
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 build artifact
uses: actions/download-artifact@v4
with:
name: redot-docs-build
path: output/
name: redot-docs-26.1
path: .

- name: Determine deploy directory
- name: List built files
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 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 ${{ env.DEPLOY_DIR }} --project-name=redot-docs --branch=${{ github.ref_name }}
command: pages deploy . --project-name=redot-docs --branch=main
9 changes: 7 additions & 2 deletions _templates/versions.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{# 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() -%}
{% 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 -%}
Expand Down
27 changes: 23 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 "========================================"
Expand Down Expand Up @@ -59,7 +70,15 @@ 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 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
Comment on lines +73 to +81
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Logic flaw: detached HEAD state defeats the --exclude-classes flag.

When the workflow runs git checkout upstream/master, Git enters detached HEAD state where git rev-parse --abbrev-ref HEAD returns "HEAD". Since the condition requires gitBranch != "HEAD", the --exclude-classes flag will never be used in the CI workflow even when BUILD_DIR is set.

If the intent is to use --exclude-classes whenever BUILD_DIR is set (regardless of HEAD state), simplify the condition:

🔧 Proposed fix
-        # 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
+        # Use --exclude-classes when BUILD_DIR is set (our versioned builds)
+        if [ -n "$BUILD_DIR" ]; then
             # Our branch with new migrate.py - use --exclude-classes
             python migrate.py --exclude-classes "$inputDir" "$migrateDir"
         else
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# 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
# Use --exclude-classes when BUILD_DIR is set (our versioned builds)
if [ -n "$BUILD_DIR" ]; 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
🤖 Prompt for AI Agents
In `@build.sh` around lines 73 - 81, The condition that checks both BUILD_DIR and
gitBranch prevents using --exclude-classes in detached HEAD (gitBranch ==
"HEAD"), so change the logic in the build.sh block that calls migrate.py to rely
only on BUILD_DIR: if [ -n "$BUILD_DIR" ]; then call python migrate.py
--exclude-classes "$inputDir" "$migrateDir" else call python migrate.py
"$inputDir" "$migrateDir" fi, leaving the gitBranch/git rev-parse logic alone or
removing the gitBranch check so that --exclude-classes is used whenever
BUILD_DIR is set regardless of detached HEAD state.

fi

echo ""
Expand Down
25 changes: 14 additions & 11 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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|
Expand Down Expand Up @@ -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 = {
Expand All @@ -187,19 +183,25 @@
"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 :)
"godot_title_prefix": "" if on_rtd else "(DEV) ",
# 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.
"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/"),
("dev", "/dev/"),
],
Comment on lines +194 to +204
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Version configuration appears inconsistent with 26.1 LTS purpose.

This conf.py is meant for the 26.1 LTS build, but:

  1. godot_version is set to "dev" (line 194) instead of "26.1"
  2. godot_versions list (lines 200-204) contains 4.3, 4.4, dev but not 26.1

If this conf.py will be used for 26.1 LTS documentation, update the values accordingly:

🔧 Suggested fix for 26.1 LTS configuration
-    "godot_version": "dev",
+    "godot_version": "26.1",
     # 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.
     "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/"),
     ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"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.
"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/"),
("dev", "/dev/"),
],
"godot_version": "26.1",
# 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.
"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/"),
],
🤖 Prompt for AI Agents
In `@conf.py` around lines 194 - 204, The configuration is for the 26.1 LTS build
but godot_version is set to "dev" and godot_versions doesn't include 26.1;
change the godot_version constant to "26.1" and update the godot_versions list
to include an entry for ("26.1", "/26.1/") (and remove or reorder the "dev"
entry if the LTS build shouldn’t advertise it), ensuring the symbols
godot_version and godot_versions in conf.py reflect the 26.1 LTS values.

}

html_logo = "img/docs_logo.svg"
Expand Down Expand Up @@ -289,6 +291,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
Expand All @@ -305,4 +308,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"