Skip to content

Commit e819903

Browse files
committed
fix(ci): sync version for PyPI publish
1 parent a828845 commit e819903

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ jobs:
5353
with:
5454
python-version: '3.10'
5555

56+
- name: Sync version in botok/vars.py to release tag
57+
if: steps.psr.outputs.released == 'true'
58+
run: |
59+
set -euo pipefail
60+
git fetch --tags --force
61+
TAG="${{ steps.psr.outputs.tag }}"
62+
if [ -z "${TAG}" ]; then
63+
TAG="$(git describe --tags --abbrev=0)"
64+
fi
65+
VERSION="${TAG#v}"
66+
echo "Using version: ${VERSION}"
67+
sed -i -E "s/^(__version__\s*=\s*\").*(\")/\1${VERSION}\2/" botok/vars.py
68+
grep -n "__version__" botok/vars.py
69+
5670
- name: Build package
5771
if: steps.psr.outputs.released == 'true'
5872
run: |

0 commit comments

Comments
 (0)