forked from maboss-bkmc/MaBoSS
-
Notifications
You must be signed in to change notification settings - Fork 2
386 lines (320 loc) · 13.9 KB
/
cmaboss-macos.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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
name: cMaBoSS MacOS
on:
push:
pull_request:
release:
types: [created]
jobs:
cmaboss_macos:
name: cMaBoSS
runs-on: macos-12
env:
CC: clang
CXX: clang++
INSTALL_PATH: /usr/local/
BUILD_PATH: /tmp/
LIBXML_LIBDIR: /usr/local/opt/libxml2/lib/libxml2.dylib
LIBXML_INCLUDEDIR: /usr/local/opt/libxml2/include/libxml2/
MACOSX_DEPLOYMENT_TARGET: 12.0
steps:
- uses: actions/checkout@v4
- name: Downgrading to XCode 13.1
run: |
sudo xcode-select -s /Applications/Xcode_13.1.app/Contents/Developer
- name: Install dependencies
run: |
brew install flex bison python3 cmake libxml2
python3 -m pip install --upgrade pip
pip3 install numpy wheel delocate pandas
- name: Set cmake version variable
run: |
echo "CMAKE_VERSION=$(cmake --version | head -n 1)" >> $GITHUB_ENV
- name: Cache compiled libSBML
id: cache-libsbml-clang
uses: actions/cache@v4
with:
path: /tmp/libsbml-5.20.4
key: ${{ runner.os }}-${{ env.CMAKE_VERSION }}-libSBML-5.20.4-clang++-namespace
- name: Compiling libSBML
if: steps.cache-libsbml-clang.outputs.cache-hit != 'true'
run: bash scripts/build_libsbml.sh
- name: Install libSBML
run: sudo bash scripts/install_libsbml.sh
- name: Build cMaBoSS
run: |
cd engine/src
make grammars
cd ../python
cp -r ../src cmaboss
python3 -m pip wheel -w wheelhouse .
delocate-wheel -w fixed_wheels -v `ls wheelhouse/cmaboss*.whl`
pip3 install `ls fixed_wheels/cmaboss*.whl`
- name: Test cMaBoSS
run: bash scripts/run_cmaboss_tests.sh
build_wheels_macos:
name: Build MacOS wheels
runs-on: macos-12
needs: cmaboss_macos
steps:
- uses: actions/checkout@v4
- name: Downgrading to XCode 13.1
run: |
sudo xcode-select -s /Applications/Xcode_13.1.app/Contents/Developer
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel numpy twine
- name: Build wheels
env:
MACOSX_DEPLOYMENT_TARGET: 12.0
CIBW_ARCHS: x86_64
CIBW_BEFORE_ALL: >
brew install libxml2 &&
CC=clang CXX=clang++ INSTALL_PATH=/usr/local/ BUILD_PATH=/tmp/ \
LIBXML_LIBDIR=/usr/local/opt/libxml2/lib/libxml2.dylib \
LIBXML_INCLUDEDIR=/usr/local/opt/libxml2/include/libxml2/ \
bash scripts/build_libsbml.sh &&
BUILD_PATH=/tmp/ bash scripts/install_libsbml.sh
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=/usr/local/lib/ delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
run: |
cd engine/src
make grammars
cd ../../
cp -r engine/src engine/python/cmaboss/
python -m cibuildwheel --output-dir wheelhouse engine/python
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-x86_64
path: wheelhouse/*.whl
- name: Upload cMaBoSS to test Pypi
if: github.repository == 'vincent-noel/MaBoSS' && github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
run: |
python -m twine upload --repository testpypi --skip-existing wheelhouse/cmaboss*
- name: Upload cMaBoSS to Pypi
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload --skip-existing wheelhouse/cmaboss*
build_wheels_macos_arm64:
name: Build MacOS wheels
runs-on: macos-14
needs: cmaboss_macos
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel numpy twine
- name: Build wheels
env:
MACOSX_DEPLOYMENT_TARGET: 14.0
CIBW_ARCHS: arm64
CIBW_BEFORE_ALL: >
brew install libxml2 &&
CC=clang CXX=clang++ INSTALL_PATH=/usr/local/ BUILD_PATH=/tmp/ \
LIBXML_LIBDIR=/opt/homebrew/opt/libxml2/lib/libxml2.dylib \
LIBXML_INCLUDEDIR=/opt/homebrew/opt/libxml2/include/ \
bash scripts/build_libsbml.sh &&
BUILD_PATH=/tmp/ sudo bash scripts/install_libsbml.sh
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=/usr/local/lib/ delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
run: |
cd engine/src
make grammars
cd ../../
cp -r engine/src engine/python/cmaboss/
python -m cibuildwheel --output-dir wheelhouse engine/python
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-arm64
path: wheelhouse/*.whl
- name: Upload cMaBoSS to test Pypi
if: github.repository == 'vincent-noel/MaBoSS' && github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
run: |
python -m twine upload --repository testpypi --skip-existing wheelhouse/cmaboss*
- name: Upload cMaBoSS to Pypi
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload --skip-existing wheelhouse/cmaboss*
conda_cmaboss_macosx_defaults:
name: cMaBoSS Conda package (defaults)
needs: cmaboss_macos
strategy:
fail-fast: false
matrix:
version: [{python: "3.8", numpy: "1.24"}, {python: "3.9", numpy: "2.0"}, {python: "3.10", numpy: "2.0"}, {python: "3.11", numpy: "2.0"}, {python: "3.12", numpy: "2.0"}]
runs-on: macos-12
defaults:
run:
shell: sh -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: defaults
python-version: 3.12
use-mamba: true
- name: Install conda-build
run: |
conda install conda-build conda-verify anaconda-client
- name: Installing MacOSX10.9 SDK
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.9.sdk.tar.xz
sudo tar xf MacOSX10.9.sdk.tar.xz -C /opt
echo "conda_build:" > ~/.condarc
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml
echo " - /opt/MacOSX10.9.sdk # [osx]" >> ~/.conda/conda_build_config.yaml
- name: Build cMaBoSS Anaconda package
env:
MACOSX_DEPLOYMENT_TARGET: 10.9
run: |
CUSTOM_BUILD_NUMBER=0 conda build -c defaults -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss;
- name: Upload MaBoSS to Anaconda cloud on vincent-noel
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /usr/local/miniconda/envs/test/conda-bld/osx-64/*.tar.bz2 --force;
- name: Upload MaBoSS to Anaconda cloud on colomoto
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /usr/local/miniconda/envs/test/conda-bld/osx-64/*.tar.bz2 --force;
conda_cmaboss_macosx_condaforge:
name: cMaBoSS Conda package (conda-forge)
needs: cmaboss_macos
strategy:
fail-fast: false
matrix:
version: [{python: "3.8", numpy: "1.24"}, {python: "3.9", numpy: "2.0"}, {python: "3.10", numpy: "2.1"}, {python: "3.11", numpy: "2.1"}, {python: "3.12", numpy: "2.1"}]
runs-on: macos-12
defaults:
run:
shell: sh -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
python-version: 3.12
use-mamba: true
- name: Install conda-build
run: |
conda install conda-build conda-verify anaconda-client
- name: Installing MacOSX10.13 SDK
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz
sudo tar xf MacOSX10.13.sdk.tar.xz -C /opt
echo "conda_build:" > ~/.condarc
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml
echo " - /opt/MacOSX10.13.sdk # [osx]" >> ~/.conda/conda_build_config.yaml
- name: Build cMaBoSS Anaconda package
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
run: |
CUSTOM_BUILD_NUMBER=1 conda build -c conda-forge -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss;
- name: Upload MaBoSS to Anaconda cloud on vincent-noel
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /usr/local/miniconda/envs/test/conda-bld/osx-64/*.tar.bz2 --force;
- name: Upload MaBoSS to Anaconda cloud on colomoto
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /usr/local/miniconda/envs/test/conda-bld/osx-64/*.tar.bz2 --force;
conda_cmaboss_macosx_M1_defaults:
name: cMaBoSS Conda package for arm64 (defaults)
needs: cmaboss_macos
strategy:
fail-fast: false
matrix:
version: [{python: "3.8", numpy: "1.24"}, {python: "3.9", numpy: "2.0"}, {python: "3.10", numpy: "2.0"}, {python: "3.11", numpy: "2.0"}, {python: "3.12", numpy: "2.0"}]
runs-on: macos-14
defaults:
run:
shell: sh -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: defaults
python-version: 3.12
use-mamba: true
- name: Install conda-build
run: |
conda install conda-build conda-verify anaconda-client
- name: Installing MacOSX11.1 SDK
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.1.sdk.tar.xz
sudo tar xf MacOSX11.1.sdk.tar.xz -C /opt
echo "conda_build:" > ~/.condarc
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml
echo " - /opt/MacOSX11.1.sdk # [osx]" >> ~/.conda/conda_build_config.yaml
- name: Build cMaBoSS Anaconda package
env:
MACOSX_DEPLOYMENT_TARGET: 11.1
run: |
CUSTOM_BUILD_NUMBER=0 conda build -c defaults -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss;
- name: Upload MaBoSS to Anaconda cloud on vincent-noel
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /Users/runner/miniconda3/envs/test/conda-bld/osx-arm64/*.tar.bz2 --force;
- name: Upload MaBoSS to Anaconda cloud on colomoto
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /Users/runner/miniconda3/envs/test/conda-bld/osx-arm64/*.tar.bz2 --force;
conda_cmaboss_macosx_M1_condaforge:
name: cMaBoSS Conda package for arm64 (conda-forge)
needs: cmaboss_macos
strategy:
fail-fast: false
matrix:
version: [{python: "3.8", numpy: "1.24"}, {python: "3.9", numpy: "2.0"}, {python: "3.10", numpy: "2.1"}, {python: "3.11", numpy: "2.1"}, {python: "3.12", numpy: "2.1"}]
runs-on: macos-14
defaults:
run:
shell: sh -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
python-version: 3.12
use-mamba: true
- name: Install conda-build
run: |
conda install conda-build conda-verify anaconda-client
- name: Installing MacOSX11.0 SDK
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz
sudo tar xf MacOSX11.0.sdk.tar.xz -C /opt
echo "conda_build:" > ~/.condarc
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml
echo " - /opt/MacOSX11.0.sdk # [osx]" >> ~/.conda/conda_build_config.yaml
- name: Build cMaBoSS Anaconda package
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
run: |
CUSTOM_BUILD_NUMBER=1 conda build -c conda-forge -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss;
- name: Upload MaBoSS to Anaconda cloud on vincent-noel
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /Users/runner/miniconda3/envs/test/conda-bld/osx-arm64/*.tar.bz2 --force;
- name: Upload MaBoSS to Anaconda cloud on colomoto
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release'
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /Users/runner/miniconda3/envs/test/conda-bld/osx-arm64/*.tar.bz2 --force;