-
Notifications
You must be signed in to change notification settings - Fork 29
213 lines (188 loc) · 6.26 KB
/
release.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: release
on:
release:
types: [published, prereleased]
jobs:
build-linux-cp36:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Install Python package dependencies
run: /opt/python/cp36-cp36m/bin/python -m pip install cython wheel setuptools
- name: Build binary wheel
run: /opt/python/cp36-cp36m/bin/python setup.py bdist_wheel
- name: Apply auditwheel
run: auditwheel repair -w dist dist/*
- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl
- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-linux-3.6
path: dist
build-linux-cp37:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Install Python package dependencies
run: /opt/python/cp37-cp37m/bin/python -m pip install cython wheel setuptools
- name: Build binary wheel
run: /opt/python/cp37-cp37m/bin/python setup.py bdist_wheel
- name: Apply auditwheel
run: auditwheel repair -w dist dist/*
- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl
- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-linux-3.7
path: dist
build-linux-cp38:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Install Python package dependencies
run: /opt/python/cp38-cp38/bin/python -m pip install cython wheel setuptools
- name: Build binary wheel
run: /opt/python/cp38-cp38/bin/python setup.py bdist_wheel
- name: Apply auditwheel for manylinux wheel
run: auditwheel repair -w dist dist/*
- name: Remove linux wheel
run: rm dist/*-linux_x86_64.whl
- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-linux-3.8
path: dist
build-macos:
runs-on: macos-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Python package dependencies
run: pip install cython wheel setuptools
- name: Build binary wheel
run: python setup.py bdist_wheel
- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-macos-${{ matrix.python-version }}
path: dist
build-windows:
runs-on: windows-latest
strategy:
max-parallel: 3
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Download Build Tools for Visual Studio 2019
run: Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe
- name: Run vs_buildtools.exe install
run: ./vs_buildtools.exe --quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140 --includeRecommended
- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Python package dependencies
run: pip install cython wheel setuptools
- name: Build binary wheel
run: python setup.py bdist_wheel
- name: Archive dist artifacts
uses: actions/upload-artifact@v1
with:
name: dist-windows-${{ matrix.python-version }}
path: dist
upload:
needs: [build-linux-cp36, build-linux-cp37, build-linux-cp38, build-macos, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cython wheel setuptools
- name: Create source dist
run: python setup.py sdist
# Linux
- name: Stage linux 3.6
uses: actions/download-artifact@v1
with:
name: dist-linux-3.6
- run: mv -v dist-linux-3.6/* dist/
- name: Stage linux 3.7
uses: actions/download-artifact@v1
with:
name: dist-linux-3.7
- run: mv -v dist-linux-3.7/* dist/
- name: Stage linux 3.8
uses: actions/download-artifact@v1
with:
name: dist-linux-3.8
- run: mv -v dist-linux-3.8/* dist/
# MacOS
- name: Stage macos 3.6
uses: actions/download-artifact@v1
with:
name: dist-macos-3.6
- run: mv -v dist-macos-3.6/* dist/
- name: Stage macos 3.7
uses: actions/download-artifact@v1
with:
name: dist-macos-3.7
- run: mv -v dist-macos-3.7/* dist/
- name: Stage macos 3.8
uses: actions/download-artifact@v1
with:
name: dist-macos-3.8
- run: mv -v dist-macos-3.8/* dist/
# Windows
- name: Stage windows 3.6
uses: actions/download-artifact@v1
with:
name: dist-windows-3.6
- run: mv -v dist-windows-3.6/* dist/
- name: Stage windows 3.7
uses: actions/download-artifact@v1
with:
name: dist-windows-3.7
- run: mv -v dist-windows-3.7/* dist/
- name: Stage windows 3.8
uses: actions/download-artifact@v1
with:
name: dist-windows-3.8
- run: mv -v dist-windows-3.8/* dist/
- name: Upload PreRelease to Test PyPi with Twine
if: "github.event.release.prerelease"
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
ls -l dist/*
pip install twine
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
- name: Upload Release to PyPi with Twine
if: "!github.event.release.prerelease"
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
ls -l dist/*
pip install twine
twine upload dist/*