@@ -45,23 +45,18 @@ jobs:
45
45
run : |
46
46
git config --global user.email "[email protected] "
47
47
git config --global user.name "Dummy User"
48
-
49
48
- name : install dependencies
50
49
run : |
51
50
sudo apt-get update
52
51
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build
53
-
54
52
- name : Run sccache-cache
55
53
uses :
mozilla-actions/[email protected]
56
-
57
54
- name : Get CMake
58
55
uses : lukka/get-cmake@latest
59
56
with :
60
57
cmakeVersion : ' 3.16.3'
61
-
62
58
- name : Print CMake version
63
59
run : cmake --version
64
-
65
60
- name : Clone latest MRtrix and switch to latest tag
66
61
run : |
67
62
mkdir $MRTRIX_HOME
71
66
git checkout pydra-usage-python-cmd
72
67
git tag -a $MRTRIX_VERSION -m"Tag used to create a pydra-mrtrix3 release"
73
68
git describe --abbrev=0
74
-
75
69
# echo "MRTRIX_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
76
70
# git checkout $MRTRIX_VERSION
77
-
78
71
- name : configure
79
72
run : |
80
73
cd $MRTRIX_HOME/src
@@ -88,40 +81,31 @@ jobs:
88
81
-D CMAKE_C_COMPILER=clang \
89
82
-D CMAKE_CXX_COMPILER=clang++ \
90
83
-D CMAKE_INSTALL_PREFIX=$MRTRIX_INSTALL
91
-
92
84
- name : Build Mrtrix
93
85
run : |
94
86
cd $MRTRIX_HOME/src
95
87
cmake --build build
96
-
97
88
- name : Install Mrtrix
98
89
run : |
99
90
cd $MRTRIX_HOME/src
100
91
cmake --install build
101
-
102
92
- name : Set PATH Variable
103
93
run : echo "PATH=$PATH:$MRTRIX_INSTALL/bin" >> $GITHUB_ENV
104
-
105
94
- name : Set LD_LIBRARY_PATH Variable
106
95
run : echo "LD_LIBRARY_PATH=$MRTRIX_INSTALL/lib" >> $GITHUB_ENV
107
-
108
96
- name : Change back to the root directory
109
97
run : cd ..
110
-
111
98
- name : Set up Python
112
99
uses : actions/setup-python@v2
113
-
114
100
- name : Install Python build dependencies
115
101
run : |
116
102
python -m pip install --upgrade pip
117
-
118
103
- name : Install pydra-auto-gen requirements
119
104
run : >
120
105
pip install
121
106
-e related-packages/fileformats
122
107
-e related-packages/fileformats-extras
123
108
-e .[dev,test]
124
-
125
109
- name : Generate task specifications
126
110
run : >
127
111
./generate.py
@@ -130,22 +114,18 @@ jobs:
130
114
$MRTRIX_VERSION
131
115
--log-errors
132
116
--latest
133
-
134
117
- name : Upload MRtrix3 install
135
118
uses : actions/upload-artifact@v2
136
119
with :
137
120
name : MRtrix3
138
121
path : ${{ env.MRTRIX_INSTALL}}
139
-
140
122
- name : Upload auto-gen pydra
141
123
uses : actions/upload-artifact@v2
142
124
with :
143
125
name : AutoGen
144
126
path : pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
145
-
146
127
- name : Write version file
147
128
run : echo $MRTRIX_VERSION > mrtrix3_version.txt
148
-
149
129
- name : Upload version file
150
130
uses : actions/upload-artifact@v2
151
131
with :
@@ -165,40 +145,32 @@ jobs:
165
145
166
146
steps :
167
147
- uses : actions/checkout@v2
168
-
169
148
- name : Download version file
170
149
uses : actions/download-artifact@v2
171
150
with :
172
151
name : VersionFile
173
152
path : mrtrix3_version.txt
174
-
175
153
- name : Extract Mrtrix version
176
154
run : echo "MRTRIX_VERSION=$(cat mrtrix3_version.txt)" >> $GITHUB_ENV
177
-
178
155
- name : Download auto-gen pydra
179
156
uses : actions/download-artifact@v2
180
157
with :
181
158
name : AutoGen
182
159
path : pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
183
-
184
160
- name : Strip auto package from gitignore so it is included in package
185
161
run : |
186
162
sed -i '/\/pydra\/tasks\/mrtrix3\/${{ env.SUBPKG_NAME }}/d' .gitignore
187
-
188
163
- name : Set up Python ${{ matrix.python-version }}
189
164
uses : actions/setup-python@v2
190
165
with :
191
166
python-version : ${{ matrix.python-version }}
192
-
193
167
- name : Install build dependencies
194
168
run : |
195
169
python -m pip install --upgrade pip
196
-
197
170
- name : Install Pydra
198
171
run : |
199
172
pip install ${{ matrix.pydra }}
200
173
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
201
-
202
174
- name : Install task package
203
175
run : |
204
176
pip install ${{ matrix.pip-flags }} "related-packages/fileformats"
@@ -221,100 +193,84 @@ jobs:
221
193
run : |
222
194
sudo apt-get update
223
195
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build
224
-
225
196
- name : Checkout code
226
197
uses : actions/checkout@v2
227
-
198
+ - name : Unset header
199
+ # checkout@v2 adds a header that makes branch protection report errors
200
+ # because the Github action bot is not a collaborator on the repo
201
+ run : git config --local --unset http.https://github.com/.extraheader
202
+ - name : Fetch tags
203
+ run : git fetch --prune --unshallow
228
204
- name : Download version file
229
205
uses : actions/download-artifact@v2
230
206
with :
231
207
name : VersionFile
232
208
path : mrtrix3_version.txt
233
-
234
209
- name : Extract Mrtrix version
235
210
run : echo "MRTRIX_VERSION=$(cat mrtrix3_version.txt)" >> $GITHUB_ENV
236
-
237
211
- name : Download auto-gen pydra
238
212
uses : actions/download-artifact@v2
239
213
with :
240
214
name : AutoGen
241
215
path : pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
242
-
243
216
- name : Strip auto package from gitignore so it is included in package
244
217
run : |
245
218
sed -i '/\/pydra\/tasks\/mrtrix3\/${{ env.SUBPKG_NAME }}/d' .gitignore
246
-
247
219
- name : Download MRtrix3 install
248
220
uses : actions/download-artifact@v2
249
221
with :
250
222
name : MRtrix3
251
223
path : ${{ env.MRTRIX_INSTALL}}
252
-
253
224
- name : Make commands executable
254
225
run : chmod +x ${{ env.MRTRIX_INSTALL }}/bin/*
255
-
256
226
- name : Set PATH Variable
257
227
run : echo "PATH=$PATH:$MRTRIX_INSTALL/bin" >> $GITHUB_ENV
258
-
259
228
- name : Set LD_LIBRARY_PATH Variable
260
229
run : echo "LD_LIBRARY_PATH=$MRTRIX_INSTALL/lib" >> $GITHUB_ENV
261
-
262
230
- name : Set up Python ${{ matrix.python-version }}
263
231
uses : actions/setup-python@v2
264
232
with :
265
233
python-version : ${{ matrix.python-version }}
266
-
267
234
- name : Install build dependencies
268
235
run : |
269
236
python -m pip install --upgrade pip
270
-
271
237
- name : Install task package
272
238
run : >
273
239
pip install
274
240
-e ./related-packages/fileformats
275
241
-e ./related-packages/fileformats-extras
276
242
-e '.[test]'
277
-
278
243
- name : Install dev branch of pydra until bugfix
279
244
run : pip install --upgrade git+https://github.com/nipype/pydra.git@typing-bugfixes
280
-
281
245
- name : Test with pytest
282
246
run : pytest -sv pydra/tasks/mrtrix3 --cov pydra.tasks.mrtrix3 --cov-report xml
283
-
284
247
- uses : codecov/codecov-action@v1
285
248
if : ${{ always() }}
286
249
287
250
deploy-fileformats :
288
251
needs : [devcheck, test]
289
252
runs-on : ubuntu-latest
290
253
steps :
291
-
292
254
- uses : actions/checkout@v3
293
255
with :
294
256
submodules : recursive
295
257
fetch-depth : 0
296
-
297
258
- name : Set up Python
298
259
uses : actions/setup-python@v4
299
260
with :
300
261
python-version : ' 3.11'
301
-
302
262
- name : Install build tools
303
263
run : python -m pip install build twine
304
-
305
264
- name : Build source and wheel distributions
306
265
run : python -m build ./related-packages/fileformats
307
-
308
266
- name : Check distributions
309
267
run : twine check ./related-packages/fileformats/dist/*
310
-
311
268
- name : Check for PyPI token on tag
312
269
id : deployable
313
270
if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
314
271
env :
315
272
PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_API_TOKEN }}"
316
273
run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
317
-
318
274
- name : Upload to PyPI
319
275
if : steps.deployable.outputs.DEPLOY
320
276
uses : pypa/gh-action-pypi-publish@release/v1
@@ -327,33 +283,26 @@ jobs:
327
283
needs : [deploy-fileformats]
328
284
runs-on : ubuntu-latest
329
285
steps :
330
-
331
286
- uses : actions/checkout@v3
332
287
with :
333
288
submodules : recursive
334
289
fetch-depth : 0
335
-
336
290
- name : Set up Python
337
291
uses : actions/setup-python@v4
338
292
with :
339
293
python-version : ' 3.11'
340
-
341
294
- name : Install build tools
342
295
run : python -m pip install build twine
343
-
344
296
- name : Build source and wheel distributions
345
297
run : python -m build ./related-packages/fileformats-extras
346
-
347
298
- name : Check distributions
348
299
run : twine check ./related-packages/fileformats-extras/dist/*
349
-
350
300
- name : Check for PyPI token on tag
351
301
id : deployable
352
302
if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
353
303
env :
354
304
PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_EXTRAS_API_TOKEN }}"
355
305
run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
356
-
357
306
- name : Upload to PyPI
358
307
if : steps.deployable.outputs.DEPLOY
359
308
uses : pypa/gh-action-pypi-publish@release/v1
@@ -367,73 +316,58 @@ jobs:
367
316
needs : [devcheck, test, deploy-fileformats, deploy-fileformats-extras]
368
317
runs-on : ubuntu-latest
369
318
steps :
370
-
371
319
- name : Checkout repo
372
320
uses : actions/checkout@v2
373
-
374
321
- name : Set up Git user
375
322
run : |
376
323
git config --local user.email "[email protected] "
377
324
git config --local user.name "GitHub Action"
378
-
379
325
- name : Download version file
380
326
uses : actions/download-artifact@v2
381
327
with :
382
328
name : VersionFile
383
329
path : mrtrix3_version.txt
384
-
385
330
- name : Extract Mrtrix version
386
331
run : echo "MRTRIX_VERSION=$(cat mrtrix3_version.txt)" >> $GITHUB_ENV
387
-
388
332
- name : Download auto-gen pydra
389
333
uses : actions/download-artifact@v2
390
334
with :
391
335
name : AutoGen
392
336
path : pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
393
-
394
337
- name : Strip auto package from gitignore so it is included in package
395
338
run : |
396
339
sed -i '/\/pydra\/tasks\/mrtrix3\/${{ env.SUBPKG_NAME }}/d' .gitignore
397
-
398
340
- name : Add auto-generated directory to git repo
399
341
if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
400
342
run : |
401
343
git add pydra/tasks/mrtrix3/$SUBPKG_NAME
402
344
git commit -am"added auto-generated version to make new tag for package version"
403
345
git status
404
-
405
346
- name : Get latest version tag
406
347
id : latest_tag
407
348
run : |
408
349
git fetch --tags
409
350
echo "TAG=$(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')" >> $GITHUB_OUTPUT
410
-
411
351
- name : Overwrite the tag of release event with latest commit (i.e. including the auto directory)
412
352
if : github.event_name == 'release'
413
353
run : |
414
354
git tag -d ${{ steps.latest_tag.outputs.TAG }};
415
355
git tag -a ${{ steps.latest_tag.outputs.TAG }} -m"Tag used to create a pydra-mrtrix3 $MRTRIX_VERSION release";
416
-
417
356
- name : Set up Python 3.11
418
357
uses : actions/setup-python@v2
419
358
with :
420
359
python-version : 3.11
421
-
422
360
- name : Install build tools
423
361
run : python -m pip install --upgrade pip twine build
424
-
425
362
- name : Build source and wheel distributions
426
363
run : python -m build
427
-
428
364
- name : Check distributions
429
365
run : twine check dist/*
430
-
431
366
- name : Upload sdist
432
367
uses : actions/upload-artifact@v2
433
368
with :
434
369
name : SDist
435
370
path : dist/*.tar.gz
436
-
437
371
# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
438
372
# Secrets are not accessible in the if: condition [0], so set an output variable [1]
439
373
# [0] https://github.community/t/16928
@@ -444,7 +378,6 @@ jobs:
444
378
env :
445
379
PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
446
380
run : if [ -n "$PYPI_API_TOKEN" ]; then echo ::set-output name=DEPLOY::true; fi
447
-
448
381
- name : Upload to PyPI
449
382
if : steps.deployable.outputs.DEPLOY
450
383
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments