Skip to content

Commit edf9b7f

Browse files
committed
Add workflow for publishing releases to PyPI
1 parent 8e8bd59 commit edf9b7f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/pypi.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
jobs:
7+
pypi:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install setuptools wheel twine
23+
24+
- name: Build release
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
28+
- name: Create GitHub release
29+
id: create_release
30+
uses: actions/create-release@v1
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: ${{ github.ref }}
36+
37+
- name: Publish package
38+
uses: pypa/gh-action-pypi-publish@master
39+
with:
40+
user: __token__
41+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)