Skip to content

Commit 38abc87

Browse files
committed
ci: Add PyPI workflow
1 parent 432e297 commit 38abc87

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/pypi.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish to PyPI
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-python@v4
9+
with:
10+
python-version: '3.10'
11+
- run: pip install --upgrade build
12+
- run: python -m build --sdist --wheel
13+
- name: Publish to TestPyPI
14+
uses: pypa/gh-action-pypi-publish@release/v1
15+
with:
16+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
17+
repository-url: https://test.pypi.org/legacy/
18+
skip-existing: true
19+
- name: Publish to PyPI
20+
if: startsWith(github.ref, 'refs/tags')
21+
uses: pypa/gh-action-pypi-publish@release/v1
22+
with:
23+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)