Skip to content

Commit ea3340c

Browse files
authored
Merge pull request #188 from staylorx/master
Add github action to publish to pypi
2 parents 48af26a + 0d1f97b commit ea3340c

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
on: [release]
3+
4+
jobs:
5+
build-n-publish:
6+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
7+
runs-on: ubuntu-18.04
8+
strategy:
9+
matrix:
10+
python-version: [3.8]
11+
12+
steps:
13+
- uses: actions/checkout@master
14+
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install pypa/build
21+
run: python -m pip install setuptools build wheel --user
22+
23+
- name: Build a binary wheel
24+
run: python setup.py sdist bdist_wheel
25+
26+
- name: Publish any distribution 📦 to Test PyPI
27+
uses: pypa/gh-action-pypi-publish@master
28+
with:
29+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
30+
repository_url: https://test.pypi.org/legacy/
31+
skip_existing: true
32+
33+
- name: Publish tagged distribution 📦 to PyPI
34+
if: startsWith(github.ref, 'refs/tags')
35+
uses: pypa/gh-action-pypi-publish@master
36+
with:
37+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build
55
*.egg-info
66
.coverage*
77
.idea/*
8+
/dist

0 commit comments

Comments
 (0)