Skip to content

Commit 48de0ad

Browse files
committed
Add PyPI deployment to workflow
1 parent befed0a commit 48de0ad

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

.github/workflows/wheels.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: [workflow_dispatch]
3+
on: [workflow_dispatch, release]
44

55
jobs:
66
build_wheels:
@@ -33,7 +33,37 @@ jobs:
3333
with:
3434
path: ./wheelhouse/*.whl
3535

36-
# - name: Publish a Python distribution to PyPI
37-
# uses: pypa/gh-action-pypi-publish@release/v1
38-
# with:
39-
# password: ${{ secrets.PYPI_API_TOKEN }}
36+
make_sdist:
37+
name: Make SDist
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0 # Optional, use if you use setuptools_scm
43+
submodules: true # Optional, use if you have submodules
44+
45+
- name: Install setup dependencies
46+
run: python -m pip install poetry
47+
48+
- name: Build SDist
49+
run: poetry build -f sdist
50+
51+
- uses: actions/upload-artifact@v3
52+
with:
53+
path: dist/*.tar.gz
54+
55+
upload_all:
56+
needs: [build_wheels, make_sdist]
57+
runs-on: ubuntu-latest
58+
if: github.event_name == 'release' && github.event.action == 'published'
59+
steps:
60+
- uses: actions/download-artifact@v3
61+
with:
62+
name: artifact
63+
path: dist
64+
65+
- name: Publish to PyPI
66+
uses: pypa/[email protected]
67+
with:
68+
user: __token__
69+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)