Update docs to automatically get release version from latest v*.*-RELEASE tag;

This commit is contained in:
gab-k committed 2025-04-27 10:20:46 +02:00
1 parent b968c6d31d
commit 24c01a0d7c
3 files changed
+38 -4

No files matched your search

+2
View File
@@ -16,6 +16,8 @@ jobs:
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all commits and tags
- name: Doxygen build - name: Doxygen build
uses: mattnotmitt/doxygen-action@v1.9.5 uses: mattnotmitt/doxygen-action@v1.9.5
+34 -2
View File
@@ -6,10 +6,41 @@
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import subprocess
import re
def get_latest_release_tag():
try:
# Get all tags matching the pattern
tags = subprocess.check_output(
['git', 'tag', '--list', 'v*-RELEASE'],
universal_newlines=True
).splitlines()
if not tags:
return "unknown"
# Sort tags in reverse version order
tags.sort(reverse=True)
latest_tag = tags[0]
# Extract version numbers (optional: you can customize this regex)
match = re.match(r'v(\d+\.\d+)-RELEASE', latest_tag)
if match:
return match.group(1)
else:
return "unknown"
except Exception:
return "unknown"
project = 'RP2040-Decoder' project = 'RP2040-Decoder'
copyright = '2024, Gabriel Koppenstein' copyright = '2024, Gabriel Koppenstein'
author = 'Gabriel Koppenstein' author = 'Gabriel Koppenstein'
release = '0.3, 1.0' release = get_latest_release_tag()
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -31,4 +62,5 @@ html_static_path = ['_static']
breathe_projects = { breathe_projects = {
"RP2040-Decoder": "../../doxygen/build/xml" "RP2040-Decoder": "../../doxygen/build/xml"
} }
breathe_default_project = "RP2040-Decoder" breathe_default_project = "RP2040-Decoder"
+2 -2
View File
@@ -1,7 +1,7 @@
Hardware Hardware
====================== ======================
Revision 1.0 USB
------------ ------------
.. toctree:: .. toctree::
@@ -9,7 +9,7 @@ Revision 1.0
USB/hw_description USB/hw_description
Revision 0.3 Legacy
------------ ------------
.. toctree:: .. toctree::