Skip to content

Commit 1aae306

Browse files
committed
Add release workflow.
1 parent f249659 commit 1aae306

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Upload Python Package
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
deploy-linux:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up Python
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.6
15+
- name: Publish linux
16+
env:
17+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
18+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
19+
run: |
20+
pip install twine
21+
docker run -v $PWD:/io quay.io/pypa/manylinux1_x86_64 "/io/build_wheels.sh"
22+
twine upload wheelhouse/*.whl --skip-existing
23+
twine upload dist/*.tar.gz
24+
deploy-mac:
25+
runs-on: macOS-latest
26+
strategy:
27+
matrix:
28+
python-version: [3.6, 3.7, 3.8]
29+
steps:
30+
- uses: actions/checkout@v1
31+
- name: Set up Python
32+
uses: actions/setup-python@v1
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Build mac wheel
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install setuptools wheel==0.31.1 twine cython
39+
python setup.py bdist_wheel
40+
- name: Test mac wheel
41+
run: |
42+
pip install dist/*.whl pytest
43+
pytest
44+
- name: Test mac wheel system python
45+
if: {{ matrix.python.version == '3.7' }}
46+
run: |
47+
/usr/bin/python3 -m venv venv
48+
source venv/bin/activate
49+
pip install dist/*.whl pytest
50+
pytest
51+
- name: Publish macos
52+
env:
53+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
54+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
55+
run: |
56+
twine upload dist/*.whl --skip-existing
57+
deploy-windows:
58+
runs-on: windows-latest
59+
strategy:
60+
matrix:
61+
python-version: [3.6, 3.7, 3.8]
62+
steps:
63+
- uses: actions/checkout@v1
64+
- name: Set up Python
65+
uses: actions/setup-python@v1
66+
with:
67+
python-version: ${{ matrix.python-version }}
68+
- name: Build windows wheel
69+
run: |
70+
python -m pip install --upgrade pip
71+
pip install setuptools wheel==0.31.1 twine cython
72+
python setup.py bdist_wheel
73+
- name: Test windows wheel
74+
run: |
75+
pip install dist/*.whl pytest
76+
pytest
77+
- name: Publish windows
78+
env:
79+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
80+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
81+
run: |
82+
twine upload dist\*.whl --skip-existing

build_wheels.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
cd io
5+
6+
for PYBIN in /opt/python/cp{36,37,38}*/bin; do
7+
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"
8+
"${PYBIN}/pip" install cython setuptools wheel
9+
"${PYBIN}/python" setup.py bdist_wheel
10+
if [[ $PYBIN == "/opt/python/cp36-cp36m/bin" ]]
11+
then
12+
"${PYBIN}/python" setup.py sdist
13+
fi
14+
done
15+
16+
for whl in dist/*.whl; do
17+
auditwheel repair "$whl"
18+
done

0 commit comments

Comments
 (0)