Skip to content

Commit b3fcac1

Browse files
committed
Add test-release workflow.
1 parent f3beecb commit b3fcac1

File tree

2 files changed

+95
-5
lines changed

2 files changed

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

.github/workflows/pythonpublish.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Upload Python Package
22
on:
33
release:
4-
types: [published]
4+
types: [released]
55

66
jobs:
77
deploy-linux:
@@ -12,15 +12,21 @@ jobs:
1212
uses: actions/setup-python@v1
1313
with:
1414
python-version: 3.6
15-
- name: Publish linux
15+
- name: Build linux wheels
16+
run: |
17+
pip install twine
18+
docker run -v $PWD:/io quay.io/pypa/manylinux1_x86_64 "/io/build_wheels.sh"
19+
- name: Test linux wheel
20+
run: |
21+
pip install dist/finalfusion*36*.whl pytest
22+
pytest
23+
- name: Upload linux wheels
1624
env:
1725
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
1826
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
1927
run: |
20-
pip install twine
21-
docker run -v $PWD:/io quay.io/pypa/manylinux1_x86_64 "/io/build_wheels.sh"
2228
twine upload wheelhouse/*.whl --skip-existing
23-
twine upload dist/*.tar.gz
29+
twine upload dist/*.tar.gz --skip-existing
2430
deploy-mac:
2531
runs-on: macOS-latest
2632
strategy:

0 commit comments

Comments
 (0)