Skip to content

Commit 815c76c

Browse files
committed
support version number changes through the github action
1 parent e956333 commit 815c76c

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/publish-pypi.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v4
2121

22+
- name: Set version from tag
23+
run: |
24+
VERSION="${GITHUB_REF_NAME#v}" # strips leading 'v', e.g. v4.0.7 → 4.0.7
25+
echo "VERSION=$VERSION" >> $GITHUB_ENV
26+
sed -i "s/^version = .*/version = \"$VERSION\"/" Software/Python/pyproject.toml
27+
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" Software/Python/brickpi3/__init__.py
28+
sed -i "s/version = \"[0-9.]\+\"/version = \"$VERSION\"/" Software/Python/README.md
29+
sed -i "s/brickpi3-[0-9.]\+/brickpi3-$VERSION/g" Software/Python/README.md
30+
2231
- name: Set up Python
2332
uses: actions/setup-python@v5
2433
with:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Python drivers for the BrickPi3
2-
__version__ = "trixie-4.0.6"
2+
__version__ = "4.0.6"
33

44
from .core import *

0 commit comments

Comments
 (0)