Skip to content

Commit 075c32b

Browse files
committed
add github workflow for publishing
1 parent afc9226 commit 075c32b

File tree

1 file changed

+44
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)