Skip to content

Commit ae914b8

Browse files
authored
pypi workflow build and publish #51 (#52)
1 parent 847cbaf commit ae914b8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/python-package.yml

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

0 commit comments

Comments
 (0)