-
Notifications
You must be signed in to change notification settings - Fork 186
338 lines (319 loc) · 10.9 KB
/
deploy.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# Python: "3.8", "3.9", "3.10"
# Older version do not support f-strings
# OS: ubuntu-20.04, ubuntu-latest
# OS: macOS-10.15, macos-11 (, macos-latest)
# OS: windows-2019
name: Python package
on:
push:
branches: [ deploy ]
# pull_request:
# branches: [ deploy ]
jobs:
# Explore-GitHub-Actions:
# runs-on: ubuntu-latest
# steps:
# - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
# - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
# - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# - name: Check out repository code
# uses: actions/checkout@v2
# - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
# - run: echo "🖥️ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# - run: echo "🍏 This job's status is ${{ job.status }}."
# # Does not produce manylinux that is required for twine
# build_unix:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# # os: [ubuntu-20.04,ubuntu-18.04]
# # python-version: ["3.8","3.9","3.10"]
# os: [ubuntu-18.04]
# python-version: ["3.9"]
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install pytest pytest-benchmark build
# python -m pip install numpy scipy matplotlib>=3.0.0
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Compile and install
# run: |
# python -m pip install . -v
# ls ${{ github.workspace }}/build || true
# - name: Test installation
# run : |
# mv dtaidistance dtaidistance_pkg
# python ./util/check_installation.py
# mv dtaidistance_pkg dtaidistance
# - name: Test with pytest
# run: |
# mv dtaidistance dtaidistance_pkg
# pytest --ignore=venv --benchmark-skip
# mv dtaidistance_pkg dtaidistance
# - name: Build
# run: |
# python -m build
# - name: Store wheels
# uses: actions/upload-artifact@v2
# with:
# name: wheels
# path: dist/*.whl
build_unix:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
# os: [ubuntu-20.04,ubuntu-18.04]
# python-version: ["3.8","3.9","3.10"]
os: [ubuntu-22.04]
# cibuildwheel will automatically provide all Python versions
python-version: ["3.9"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.3.1
- name: Build wheel
run: |
pwd
ls
python -m cibuildwheel --output-dir dist/
env:
CIBW_BUILD_VERBOSITY: 2
# cp36-* and cp37-* do not support f-strings
CIBW_SKIP: cp36-* pp* *-manylinux_i686 *-musllinux_i686 *-musllinux_x86_64
CIBW_TEST_EXTRAS: "dev"
CIBW_TEST_COMMAND: pytest --ignore=venv --benchmark-skip {project}/tests
- name: Store wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl
build_macos:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-11, macos-12, macos-13, macos-14]
python-version: ["3.8","3.9","3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Install OpenMP
run: |
# OpenMP libraries are not installed by default on macos
clang --version
clang --version | grep "\(13\.\|14\.\|15\.\)"
# hardcoded, not ideal
# https://mac.r-project.org/openmp/
# This includes only the dynamic library
curl -O https://mac.r-project.org/openmp/openmp-13.0.0-darwin21-Release.tar.gz
sudo tar fvxz openmp-13.0.0-darwin21-Release.tar.gz -C /
ls /usr/local/lib
ls /usr/local/include
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-benchmark build
python -m pip install numpy scipy matplotlib>=3.0.0
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Compile and install
run: |
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
python -m pip install . -v
ls ${{ github.workspace }}/build || true
- name: Test installation
run : |
mv dtaidistance dtaidistance_pkg
python ./util/check_installation.py
mv dtaidistance_pkg dtaidistance
- name: Test with pytest
run: |
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
mv dtaidistance dtaidistance_pkg
pytest --ignore=venv --benchmark-skip
mv dtaidistance_pkg dtaidistance
- name: Build
run: |
python -m build
- name: Store wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl
build_macos_arm:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-13-arm64, macos-14-arm64]
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Install OpenMP
run: |
# OpenMP libraries are not installed by default on macos
clang --version
clang --version | grep "\(13\.\|14\.\|15\.\)"
# hardcoded, not ideal
# https://mac.r-project.org/openmp/
# This includes only the dynamic library
curl -O https://mac.r-project.org/openmp/openmp-13.0.0-darwin21-Release.tar.gz
sudo tar fvxz openmp-13.0.0-darwin21-Release.tar.gz -C /
ls /usr/local/lib
ls /usr/local/include
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-benchmark build
python -m pip install numpy scipy matplotlib>=3.0.0
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Compile and install
run: |
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
python -m pip install . -v
ls ${{ github.workspace }}/build || true
- name: Test installation
run : |
mv dtaidistance dtaidistance_pkg
python ./util/check_installation.py
mv dtaidistance_pkg dtaidistance
- name: Test with pytest
run: |
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
mv dtaidistance dtaidistance_pkg
pytest --ignore=venv --benchmark-skip
mv dtaidistance_pkg dtaidistance
- name: Build
run: |
python -m build
- name: Store wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl
build_windows:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-2019, windows-2022]
python-version: ["3.8","3.9","3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-benchmark pytest-env build cython
python -m pip install numpy scipy matplotlib>=3.0.0
- name: Compile and install
run: |
python -m pip install . -v
ls ${{ github.workspace }}/build || true
- name: Test installation
run : |
mv dtaidistance dtaidistance_pkg
python ./util/check_installation.py
mv dtaidistance_pkg dtaidistance
- name: Test with pytest
run: |
mv dtaidistance dtaidistance_pkg
pytest --ignore=venv --benchmark-skip -c pytest-noviz.ini
mv dtaidistance_pkg dtaidistance
- name: Build
run: |
python -m build
- name: Store wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl
build_sdist:
name: Prepare source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Build
run: |
python -m pip install build
python -m build --sdist
- name: Store artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.tar.gz
upload_wheels:
name: Upload wheels to PyPi
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs: [build_unix,build_macos,build_windows,build_sdist]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist/
# test_upload_wheels:
# name: Upload wheels to TestPyPi
# runs-on: ubuntu-latest
# # upload to PyPI on every tag starting with 'v'
# # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# needs: [build_unix,build_macos,build_windows,build_sdist]
# # needs: [build_unix]
# steps:
# - uses: actions/download-artifact@v2
# with:
# name: wheels
# path: dist
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN_TEST }}
# repository_url: https://test.pypi.org/legacy/