From ce08557d3761d5123ce7c8e7e7769264c9341c32 Mon Sep 17 00:00:00 2001 From: rettigl Date: Mon, 11 Nov 2024 21:33:12 +0100 Subject: [PATCH] change version in release documentation builds --- .github/workflows/documentation.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b8286e7d..2bdc8cee 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -79,6 +79,14 @@ jobs: echo $MOD_VERSION sed -i "s/^version = \"$VERSION\"/version = \"$MOD_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml + - name: Change version for release build + if: startsWith(github.ref, 'refs/tags/') + run: | + OLD_VERSION=`sed -n 's/^version = "\(.*\)".*/\1/p' $GITHUB_WORKSPACE/pyproject.toml` + NEW_VERSION=`echo ${GITHUB_REF#refs/tags/} | sed -n 's/^v\(.*\)/\1/p'` + echo $NEW_VERSION + sed -i "s/^version = \"$OLD_VERSION\"/version = \"$NEW_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml + - name: build Sphinx docs run: poetry run sphinx-build -b html $GITHUB_WORKSPACE/docs $GITHUB_WORKSPACE/_build