Skip to content

Commit 4f0ac59

Browse files
build-ants.yml: Add curl+unzip for prebuilt binaries
1 parent 3640b63 commit 4f0ac59

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

.github/workflows/build-ants.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
pull_request:
55
branches: [ master ]
66
workflow_dispatch:
7-
inputs:
8-
git_ref:
9-
description: 'Upstream ANTsX/ANTs commit ref to check out when building'
10-
required: true
11-
default: 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120'
127

138
jobs:
149

@@ -26,10 +21,22 @@ jobs:
2621
echo "ARTIFACT=$OS" >> $GITHUB_ENV
2722
- name: package
2823
run: |
24+
# download and extract pre-built ants
25+
case "${{ env.ARTIFACT }}" in
26+
ubuntu-latest)
27+
URL="https://github.com/ANTsX/ANTs/releases/download/v2.4.4/ants-2.4.4-ubuntu-22.04-X64-gcc.zip"
28+
;;
29+
macos-latest)
30+
URL="https://github.com/ANTsX/ANTs/releases/download/v2.4.4/ants-2.4.4-macos-12-X64-clang.zip"
31+
;;
32+
esac
33+
curl -L "$URL" -o ants-unix.zip
34+
unzip ants-unix.zip
2935
# snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
3036
mkdir sct-apps/
31-
cp antsbin/ANTS-build/Examples/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps
37+
cp ants-2.4.4/bin/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps
3238
(cd sct-apps; for i in *; do mv $i isct_$i; done)
39+
curl https://raw.githubusercontent.com/ANTsX/ANTs/refs/heads/master/COPYING.txt -o COPYING.txt
3340
cp COPYING.txt sct-apps
3441
tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/
3542
continue-on-error: true
@@ -49,14 +56,25 @@ jobs:
4956
runs-on: ubuntu-latest
5057
container: ${{ matrix.os }}
5158
steps:
59+
- name: install centos toolchain
60+
if: contains(matrix.os, 'centos:stream8')
61+
run: |
62+
# Sed commands come from https://archive.ph/FS47T
63+
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
64+
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
65+
yum install -y gcc git curl unzip
5266
- name: package
5367
run: |
68+
# download and extract pre-built ants
69+
curl -L "https://github.com/ANTsX/ANTs/releases/download/v2.4.4/ants-2.4.4-centos7-X64-gcc.zip" -o ants-centos.zip
70+
unzip ants-centos.zip
5471
# snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
5572
mkdir sct-apps/
56-
cp antsbin/ANTS-build/Examples/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps
73+
cp ants-2.4.4/bin/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps
5774
(cd sct-apps; for i in `ls`; do mv $i isct_$i; done)
75+
curl https://raw.githubusercontent.com/ANTsX/ANTs/refs/heads/master/COPYING.txt -o COPYING.txt
5876
cp COPYING.txt sct-apps
59-
tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/
77+
tar -zcvf sct-apps_centos-8.tar.gz sct-apps/
6078
continue-on-error: true
6179
- name: results (DEBUG)
6280
run: find .
@@ -84,10 +102,13 @@ jobs:
84102
echo "ARTIFACT=$OS" >> $GITHUB_ENV
85103
- name: package
86104
run: |
105+
curl -L "https://github.com/ANTsX/ANTs/releases/download/v2.4.4/ants-2.4.4-windows-2022-X64-VS2019.zip" -o ants-windows.zip
106+
unzip ants-windows.zip
87107
# snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much
88108
mkdir sct-apps/
89-
cp antsbin/ANTS-build/Examples/Release/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform}.exe sct-apps
109+
cp ants-2.4.4/bin/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform}.exe sct-apps
90110
(cd sct-apps; for i in `ls`; do mv $i isct_$i; done)
111+
curl https://raw.githubusercontent.com/ANTsX/ANTs/refs/heads/master/COPYING.txt -o COPYING.txt
91112
cp COPYING.txt sct-apps
92113
tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/
93114
continue-on-error: true
@@ -148,4 +169,4 @@ jobs:
148169
name: Release ${{ github.sha }}
149170
draft: true
150171
prerelease: true
151-
artifacts: 'sct-apps_centos-8/sct-apps_centos-8.tar.gz,sct-apps_ubuntu-latest/sct-apps_ubuntu-latest.tar.gz,sct-apps_macos-latest/sct-apps_macos-latest.tar.gz,sct-apps_windows-latest/sct-apps_windows-latest.tar.gz'
172+
artifacts: 'sct-apps_centos-8.tar.gz,sct-apps_ubuntu-latest.tar.gz,sct-apps_macos-latest.tar.gz,sct-apps_windows-latest.tar.gz'

0 commit comments

Comments
 (0)