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 <noreply@anthropic.com>
This commit is contained in:
2026-08-26 13:56:02 +02:00
co-authored by Claude Sonnet 5
parent 3a725f6fda
commit 8411e6ee16
2 changed files with 51 additions and 1 deletions
+50
View File
@@ -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
+1 -1
View File
@@ -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