From 8411e6ee16eec6adb129a4d98b7af5b59e850765 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 26 Aug 2026 10:50:50 +0200 Subject: [PATCH] doc: derive Doxygen PROJECT_NUMBER from CMakeLists.txt version Extract the project version from the top-level CMakeLists.txt in the Gitea Actions pages workflow and pass it to Doxygen via the MUSRFIT_VERSION env var, so musrfit_dox.cfg's PROJECT_NUMBER no longer needs to be kept in sync by hand. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/deploy-pages.yml | 50 +++++++++++++++++++++++++++++++ doc/musrfit_dox.cfg | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/deploy-pages.yml diff --git a/.gitea/workflows/deploy-pages.yml b/.gitea/workflows/deploy-pages.yml new file mode 100644 index 00000000..2632541c --- /dev/null +++ b/.gitea/workflows/deploy-pages.yml @@ -0,0 +1,50 @@ +name: Build and Deploy Documentation + +on: + push: + branches: + - root6 + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + container: + image: gitea.psi.ch/images/alpine-jupyterbook + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + apk add doxygen graphviz + + - name: Extract project version from CMakeLists.txt + run: | + VERSION=$(grep -oP 'project\(\s*musrfit\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) + echo "MUSRFIT_VERSION=$VERSION" >> $GITHUB_ENV + + - name: Build musrfit-tech-docu + run: | + cd doc + mkdir technical + doxygen musrfit_dox.cfg + doxygen musredit_qt6_dox.cfg + doxygen mupp_qt6_dox.cfg + doxygen musrStep_qt6_dox.cfg + doxygen musrWiz_qt6_dox.cfg + + - name: Configure Git + run: | + git config --global user.name "Gitea Actions" + git config --global user.email "actions@gitea.local" + + - name: Push to gitea-pages branch + run: | + git checkout --orphan gitea-pages + git reset --hard + cp -r ./doc/technical/html/* . + git add . + git commit -m "Deploy site" + git push --verbose -f https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git gitea-pages diff --git a/doc/musrfit_dox.cfg b/doc/musrfit_dox.cfg index 91f40a20..3a8eabd1 100644 --- a/doc/musrfit_dox.cfg +++ b/doc/musrfit_dox.cfg @@ -38,7 +38,7 @@ PROJECT_NAME = musrfit # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.10 +PROJECT_NUMBER = $(MUSRFIT_VERSION) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a