-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (80 loc) · 2.51 KB
/
pythonpublish.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm numpy cibuildwheel wheel twine
- name: Build
env:
CIBW_BEFORE_BUILD: "pip install -U numpy"
CIBW_SKIP: "cp27-* cp34-* cp35-*"
run: |
python setup.py sdist -d wheelhouseLinux
python -m cibuildwheel --platform linux --output-dir wheelhouseLinux
- name: Archive wheels
uses: actions/upload-artifact@v1
with:
name: wheelhouseLinux
path: wheelhouseLinux
deploy-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
brew install gcc
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm numpy cibuildwheel wheel twine
- name: Build
env:
CIBW_BEFORE_BUILD: "pip install -U numpy"
CIBW_SKIP: "cp27-* cp34-* cp35-*"
run: |
python -m cibuildwheel --platform macos --output-dir wheelhouseMacOS
- name: Archive wheels
uses: actions/upload-artifact@v1
with:
name: wheelhouseMacOS
path: wheelhouseMacOS
deploy:
needs: [deploy-linux, deploy-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine
- name: Download archived MacOS wheels
uses: actions/download-artifact@v1
with:
name: wheelhouseMacOS
- name: Download archived Linux wheels
uses: actions/download-artifact@v1
with:
name: wheelhouseLinux
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
ls -ltrh wheelhouseMacOS/ wheelhouseLinux/
twine upload --skip-existing wheelhouseLinux/* wheelhouseMacOS/*