We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pyproject.toml
1 parent 775f92d commit b1b67d1Copy full SHA for b1b67d1
1 file changed
.github/workflows/publish-pypi.yml
@@ -18,6 +18,26 @@ jobs:
18
with:
19
python-version: "3.11"
20
21
+ - name: Extract version from tag
22
+ id: get_version
23
+ run: |
24
+ # Get tag from release event or use ref for workflow_dispatch
25
+ if [ "${{ github.event_name }}" = "release" ]; then
26
+ TAG="${{ github.event.release.tag_name }}"
27
+ else
28
+ TAG="${{ github.ref_name }}"
29
+ fi
30
+ # Remove 'v' prefix if present
31
+ VERSION="${TAG#v}"
32
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
33
+ echo "Extracted version: $VERSION"
34
+
35
+ - name: Update version in pyproject.toml
36
37
+ sed -i "s/^version = .*/version = \"${{ steps.get_version.outputs.VERSION }}\"/" pyproject.toml
38
+ echo "Updated pyproject.toml:"
39
+ grep "^version" pyproject.toml
40
41
- name: Install build tooling
42
run: |
43
python -m pip install --upgrade pip
0 commit comments