Skip to content

Commit 7c38c8a

Browse files
committed
support tags
1 parent 27f58ea commit 7c38c8a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
environment: release
7070
permissions:
7171
id-token: write
72+
contents: write
7273
steps:
7374
- uses: actions/checkout@v4
7475

@@ -90,3 +91,12 @@ jobs:
9091

9192
- name: Publish to PyPI
9293
uses: pypa/gh-action-pypi-publish@release/v1
94+
95+
- name: Create and push git tag
96+
run: |
97+
VERSION=$(grep '^version = ' pyproject.toml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
98+
TAG="v${VERSION}"
99+
git config user.name "github-actions[bot]"
100+
git config user.email "github-actions[bot]@users.noreply.github.com"
101+
git tag -a "$TAG" -m "Release version $VERSION" ${{ github.sha }}
102+
git push origin "$TAG"

0 commit comments

Comments
 (0)