@@ -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,66 +193,55 @@ 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
- - name : Install dev branch of pydra until bugfix
279
- run : pip install --upgrade git+https://github.com/nipype/pydra.git@typing-bugfixes
280
-
281
243
- name : Test with pytest
282
244
run : pytest -sv pydra/tasks/mrtrix3 --cov pydra.tasks.mrtrix3 --cov-report xml
283
-
284
245
- uses : codecov/codecov-action@v1
285
246
if : ${{ always() }}
286
247
@@ -304,7 +265,7 @@ jobs:
304
265
run : twine check ./related-packages/fileformats/dist/*
305
266
- name : Check for PyPI token on tag
306
267
id : deployable
307
- if : github.event_name == 'release'
268
+ if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
308
269
env :
309
270
PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_API_TOKEN }}"
310
271
run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
@@ -336,7 +297,7 @@ jobs:
336
297
run : twine check ./related-packages/fileformats-extras/dist/*
337
298
- name : Check for PyPI token on tag
338
299
id : deployable
339
- if : github.event_name == 'release'
300
+ if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
340
301
env :
341
302
PYPI_API_TOKEN : " ${{ secrets.PYPI_FILEFORMATS_EXTRAS_API_TOKEN }}"
342
303
run : if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi
@@ -353,73 +314,58 @@ jobs:
353
314
needs : [devcheck, test, deploy-fileformats, deploy-fileformats-extras]
354
315
runs-on : ubuntu-latest
355
316
steps :
356
-
357
317
- name : Checkout repo
358
318
uses : actions/checkout@v2
359
-
360
319
- name : Set up Git user
361
320
run : |
362
321
git config --local user.email "[email protected] "
363
322
git config --local user.name "GitHub Action"
364
-
365
323
- name : Download version file
366
324
uses : actions/download-artifact@v2
367
325
with :
368
326
name : VersionFile
369
327
path : mrtrix3_version.txt
370
-
371
328
- name : Extract Mrtrix version
372
329
run : echo "MRTRIX_VERSION=$(cat mrtrix3_version.txt)" >> $GITHUB_ENV
373
-
374
330
- name : Download auto-gen pydra
375
331
uses : actions/download-artifact@v2
376
332
with :
377
333
name : AutoGen
378
334
path : pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
379
-
380
335
- name : Strip auto package from gitignore so it is included in package
381
336
run : |
382
337
sed -i '/\/pydra\/tasks\/mrtrix3\/${{ env.SUBPKG_NAME }}/d' .gitignore
383
-
384
338
- name : Add auto-generated directory to git repo
385
339
if : github.event_name == 'release' || github.event_name == 'repository_dispatch'
386
340
run : |
387
341
git add pydra/tasks/mrtrix3/$SUBPKG_NAME
388
342
git commit -am"added auto-generated version to make new tag for package version"
389
343
git status
390
-
391
344
- name : Get latest version tag
392
345
id : latest_tag
393
346
run : |
394
347
git fetch --tags
395
348
echo "TAG=$(git tag -l | grep 'v.*' | tail -n 1 | awk -F post '{print $1}')" >> $GITHUB_OUTPUT
396
-
397
349
- name : Overwrite the tag of release event with latest commit (i.e. including the auto directory)
398
350
if : github.event_name == 'release'
399
351
run : |
400
352
git tag -d ${{ steps.latest_tag.outputs.TAG }};
401
353
git tag -a ${{ steps.latest_tag.outputs.TAG }} -m"Tag used to create a pydra-mrtrix3 $MRTRIX_VERSION release";
402
-
403
354
- name : Set up Python 3.11
404
355
uses : actions/setup-python@v2
405
356
with :
406
357
python-version : 3.11
407
-
408
358
- name : Install build tools
409
359
run : python -m pip install --upgrade pip twine build
410
-
411
360
- name : Build source and wheel distributions
412
361
run : python -m build
413
-
414
362
- name : Check distributions
415
363
run : twine check dist/*
416
-
417
364
- name : Upload sdist
418
365
uses : actions/upload-artifact@v2
419
366
with :
420
367
name : SDist
421
368
path : dist/*.tar.gz
422
-
423
369
# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets.
424
370
# Secrets are not accessible in the if: condition [0], so set an output variable [1]
425
371
# [0] https://github.community/t/16928
@@ -430,7 +376,6 @@ jobs:
430
376
env :
431
377
PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
432
378
run : if [ -n "$PYPI_API_TOKEN" ]; then echo ::set-output name=DEPLOY::true; fi
433
-
434
379
- name : Upload to PyPI
435
380
if : steps.deployable.outputs.DEPLOY
436
381
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments