Skip to content

Commit aa534f0

Browse files
Update version in setup.py
1 parent 748e53e commit aa534f0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,31 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
26+
- name: Extract version from tag
27+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
28+
29+
- name: Update version in setup.py
30+
uses: jacobtomlinson/gha-find-replace@v2
31+
with:
32+
find: "version='[0-9]+\\.[0-9]+\\.[0-9]+'"
33+
replace: "version='${{ env.VERSION }}'"
34+
regex: true
35+
include: 'setup.py'
36+
2537
- name: Set up Python
2638
uses: actions/setup-python@v3
2739
with:
2840
python-version: '3.x'
41+
2942
- name: Install dependencies
3043
run: |
3144
python -m pip install --upgrade pip
3245
pip install build
46+
3347
- name: Build package
3448
run: python -m build
49+
3550
- name: Publish package
3651
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
3752
with:

0 commit comments

Comments
 (0)