Skip to content

Commit 380245c

Browse files
committed
feat(publish): also update version
1 parent c520a2b commit 380245c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/pypi-publish.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,36 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13+
1314
- uses: actions/setup-python@v4
1415
with:
1516
python-version: "3.10"
1617

18+
- name: Extract release version
19+
id: get_version
20+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
21+
22+
- name: Update version in pyproject.toml
23+
working-directory: src/python
24+
run: |
25+
sed -i '' 's/^version = .*/version = "${{ env.version }}"/' pyproject.toml
26+
27+
- name: Commit updated pyproject.toml
28+
run: |
29+
git config user.name "GitHub Actions"
30+
git config user.email "[email protected]"
31+
git add pyproject.toml
32+
git commit -m "Bump version to ${{ env.version }}"
33+
git push
34+
working-directory: src/python
35+
1736
- name: Install dependencies
1837
working-directory: src/python
1938
run: |
2039
python -m pip install --upgrade pip
2140
pip install build
2241
23-
- name: build a binary wheel dist
42+
- name: Build a binary wheel dist
2443
working-directory: src/python
2544
run: |
2645
rm -rf dist
@@ -36,4 +55,4 @@ jobs:
3655
with:
3756
packages-dir: src/python/dist/
3857
user: __token__
39-
password: ${{ secrets.PYPI_API_TOKEN }}
58+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)