Skip to content

Commit efbbcd5

Browse files
committed
Release wheels and source to PyPI with GH actions
1 parent 0c9ea6f commit efbbcd5

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release Wheels
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v2
16+
name: Install Python
17+
with:
18+
python-version: '3.8'
19+
- run: pip install wheel
20+
- name: Build wheels
21+
run: python setup.py bdist_wheel
22+
- uses: actions/upload-artifact@v2
23+
with:
24+
path: dist/*.whl
25+
26+
build_sdist:
27+
name: Build source distribution
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-python@v2
32+
name: Install Python
33+
with:
34+
python-version: '3.8'
35+
- name: Build sdist
36+
run: python setup.py sdist
37+
- uses: actions/upload-artifact@v2
38+
with:
39+
path: dist/*.tar.gz
40+
41+
upload_pypi:
42+
needs: [build_wheels, build_sdist]
43+
runs-on: ubuntu-20.04
44+
# upload to PyPI when a GitHub Release is created
45+
if: github.event_name == 'release' && github.event.action == 'published'
46+
steps:
47+
- uses: actions/download-artifact@v2
48+
with:
49+
name: artifact
50+
path: dist
51+
52+
- uses: pypa/gh-action-pypi-publish@master
53+
with:
54+
user: __token__
55+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)