Skip to content

Commit bdf30e5

Browse files
committed
feat: add pypi release
1 parent ba34443 commit bdf30e5

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,20 @@ jobs:
5252
- name: Release
5353
env:
5454
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
56-
run: semantic-release publish
55+
run:
56+
semnatic-release --version
57+
semantic-release publish
58+
- name: Build and publish to PyPI
59+
env:
60+
TWINE_USERNAME: __token__
61+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
62+
run: |
63+
# Only build and publish if a new tag was created
64+
if git describe --tags --exact-match HEAD >/dev/null 2>&1; then
65+
echo "New release detected, building and publishing..."
66+
python -m build
67+
twine check dist/*
68+
twine upload dist/* --verbose
69+
else
70+
echo "No new release, skipping PyPI upload"
71+
fi

0 commit comments

Comments
 (0)