Skip to content

Commit ce08557

Browse files
committed
change version in release documentation builds
1 parent a43b431 commit ce08557

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/documentation.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ jobs:
7979
echo $MOD_VERSION
8080
sed -i "s/^version = \"$VERSION\"/version = \"$MOD_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml
8181
82+
- name: Change version for release build
83+
if: startsWith(github.ref, 'refs/tags/')
84+
run: |
85+
OLD_VERSION=`sed -n 's/^version = "\(.*\)".*/\1/p' $GITHUB_WORKSPACE/pyproject.toml`
86+
NEW_VERSION=`echo ${GITHUB_REF#refs/tags/} | sed -n 's/^v\(.*\)/\1/p'`
87+
echo $NEW_VERSION
88+
sed -i "s/^version = \"$OLD_VERSION\"/version = \"$NEW_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml
89+
8290
- name: build Sphinx docs
8391
run: poetry run sphinx-build -b html $GITHUB_WORKSPACE/docs $GITHUB_WORKSPACE/_build
8492

0 commit comments

Comments
 (0)