From e003592430188fd87e1476963508a5e2ff1f87e0 Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Fri, 25 Jul 2025 09:11:23 +0200 Subject: [PATCH] ci: fix sphinx-multiversion tag detection in CI - add GIT_DEPTH: 0 to build-docs job for full clone - add explicit git fetch --tags to ensure all tags are available - add debug commands to troubleshoot tag/branch availability - add sphinx-multiversion --dump-metadata for version detection This should fix the issue where v3.0.0 tag was not being picked up by sphinx-multiversion in GitLab CI, even though it works locally. --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9be8f2d..59c18ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,14 +47,24 @@ secret_detection: build-docs: stage: build-docs image: python:3 + variables: + GIT_DEPTH: 0 # Ensure full clone for sphinx-multiversion before_script: - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-doc.txt - git fetch --unshallow || true # Ensure we have full git history for multiversion + - git fetch origin --tags || true # Ensure all tags are fetched from origin - git config --global --add safe.directory $CI_PROJECT_DIR script: + - echo "Current commit:" $CI_COMMIT_SHA + - echo "Current tag:" $CI_COMMIT_TAG + - echo "Current branch:" $CI_COMMIT_BRANCH + - git tag -l + - git branch -a - cd docs + - echo "Sphinx-multiversion detected versions:" + - sphinx-multiversion --dump-metadata source build/multiversion/html - make multiversion artifacts: paths: