-
Notifications
You must be signed in to change notification settings - Fork 321
46 lines (42 loc) · 1.37 KB
/
pypiupload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Publish to PyPi
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [2.7, 3.7]
steps:
- uses: actions/[email protected]
- if: ${{ matrix.python-version == '2.7' }}
name: Setup Python environment (2.7)
run: |
sudo apt-get install python-is-python2
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
- if: ${{ matrix.python-version != '2.7' }}
name: Setup Python environment
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: |
python setup.py bdist_wheel
- name: Build Sources (Python 3)
run: python setup.py sdist
if: ${{ matrix.python-version != '2.7' }}
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_secret }}
run: |
twine check dist/*
twine upload dist/*