Skip to content

Commit d82524c

Browse files
authored
Add git workflow for publishing to pypi and test pypi (#1228)
* add git workflow for publishing to pypi
1 parent 9892766 commit d82524c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI
8+
runs-on: ubuntu-latest
9+
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+
17+
- name: Install
18+
if: startsWith(github.ref, 'refs/tags')
19+
run: >-
20+
python3 -m
21+
pip install
22+
--user
23+
--upgrade setuptools wheel
24+
25+
- name: Build a binary wheel and a source tarball
26+
if: startsWith(github.ref, 'refs/tags')
27+
run: >-
28+
python3 setup.py
29+
sdist
30+
bdist_wheel
31+
32+
- name: Publish distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)