diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e7381b3..3604d58 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v4 + with: + fetch-depth: 0 # fetch all commits and tags - name: Doxygen build uses: mattnotmitt/doxygen-action@v1.9.5 diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index 59b9d4f..28c6259 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -6,10 +6,41 @@ # -- 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' copyright = '2024, Gabriel Koppenstein' author = 'Gabriel Koppenstein' -release = '0.3, 1.0' +release = get_latest_release_tag() # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -31,4 +62,5 @@ html_static_path = ['_static'] breathe_projects = { "RP2040-Decoder": "../../doxygen/build/xml" } -breathe_default_project = "RP2040-Decoder" \ No newline at end of file +breathe_default_project = "RP2040-Decoder" + diff --git a/docs/sphinx/source/hardware/index.rst b/docs/sphinx/source/hardware/index.rst index 8f84458..12feb2c 100644 --- a/docs/sphinx/source/hardware/index.rst +++ b/docs/sphinx/source/hardware/index.rst @@ -1,7 +1,7 @@ Hardware ====================== -Revision 1.0 +USB ------------ .. toctree:: @@ -9,7 +9,7 @@ Revision 1.0 USB/hw_description -Revision 0.3 +Legacy ------------ .. toctree::