Skip to content

Commit 4f39e3d

Browse files
authored
Create PyPi Upload Action (#186)
Create PyPi Upload Action - Add action to upload to PyPi - Publish python2 and python3 builds - Publish python3 source
1 parent 129035e commit 4f39e3d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/pypiupload.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Publish to PyPi
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [2.7, 3.x]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Publish to PyPi
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine
27+
- name: Build
28+
run: |
29+
python setup.py bdist_wheel
30+
- name: Build Sources
31+
run: |
32+
python setup.py sdist
33+
if: ${{ matrix.python-version }} == '3.x'
34+
- name: Publish
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.pypi_secret }}
38+
run: |
39+
twine check dist/*
40+
twine upload dist/*

0 commit comments

Comments
 (0)