From 579502a977bc5b0f1a5708312fa716f875064132 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 09:40:27 -0400 Subject: [PATCH 01/22] `build-ants.yml`: Comment out workflow trigger to save resources --- .github/workflows/build-ants.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ants.yml b/.github/workflows/build-ants.yml index dd81581..c75bbed 100644 --- a/.github/workflows/build-ants.yml +++ b/.github/workflows/build-ants.yml @@ -1,8 +1,8 @@ name: Build ANTs on: - pull_request: - branches: [ master ] +# pull_request: +# branches: [ master ] workflow_dispatch: inputs: git_ref: From 13e9c2b1cc25d7e2cb3b84a4a85c6d8188e5fad8 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 09:40:43 -0400 Subject: [PATCH 02/22] `build-ants-windows.yml`: Copy Linux build step to debug --- .github/workflows/build-ants-windows.yml | 114 +++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/build-ants-windows.yml diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml new file mode 100644 index 0000000..d88d0d6 --- /dev/null +++ b/.github/workflows/build-ants-windows.yml @@ -0,0 +1,114 @@ +name: Build ANTs + +on: + pull_request: + branches: [ master ] + workflow_dispatch: + inputs: + git_ref: + description: 'Upstream ANTsX/ANTs commit ref to check out when building' + required: true + default: 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' + +jobs: + + build: + strategy: + matrix: + os: [ windows-2019 ] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + # first, rewrite OS names to be safe for github artifacts. + - name: names + run: | + OS="${{ matrix.os }}" + OS=$(echo "$OS" | sed s/://) + echo "ARTIFACT=$OS" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + repository: ANTsX/ANTs + # NB: This commit mirrors the state of the kousu/ANTs repository + # at the time of https://github.com/kousu/ANTs/pull/5. + ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} + # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: + # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git + - name: Patch in fix for insecure git:// protocol + run: | + perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake + - name: cmake generate + run: | + mkdir antsbin + cd antsbin + # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it + # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 + cmake \ + -DBUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ + ../ + - name: make + working-directory: antsbin + run: | + make VERBOSE=1 -j 4 + timeout-minutes: 300 + # for debugging, don't let a crash/timeout here fail the whole build + # (github CI seems glitchy about giving reliable output about what happened on timeouts) + continue-on-error: true + - name: pre-package + run: | + mkdir fakeroot/ + cd antsbin/ANTS-build + make VERBOSE=1 -j 4 DESTDIR="../../fakeroot" install + continue-on-error: true + - name: package + run: | + # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much + mkdir sct-apps/ + cp antsbin/ANTS-build/Examples/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps + (cd sct-apps; for i in `ls`; do mv $i isct_$i; done) + cp COPYING.txt sct-apps + tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/ + continue-on-error: true + - name: results (DEBUG) + run: find . + - name: Upload result + uses: actions/upload-artifact@v2-preview + with: + name: sct-apps_${{ env.ARTIFACT }} + #path: fakeroot/ # this is 2.3G large in this build + path: sct-apps_${{ env.ARTIFACT }}.tar.gz + + release: + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # name the release with the run_id to allow multiple builds on the same branch/tag + # https://github.com/actions/create-release/issues/2#issuecomment-613591846 + tag_name: ${{ github.ref }}-${{github.run_id }} + release_name: Release ${{ github.sha }} + draft: true + prerelease: true + + - uses: actions/download-artifact@v1 + with: + name: sct-apps_windows-2019 + continue-on-error: true + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./sct-apps_windows-2019/sct-apps_windows-2019.tar.gz + asset_name: sct-apps_windows-2019.tar.gz + asset_content_type: application/gzip + continue-on-error: true From 2be97813b72e6773a7929f374f81d34607164b5c Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 09:53:00 -0400 Subject: [PATCH 03/22] `build-ants-windows.yml`: Install zlib using MSYS2 --- .github/workflows/build-ants-windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index d88d0d6..4e3c63b 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -27,6 +27,11 @@ jobs: OS="${{ matrix.os }}" OS=$(echo "$OS" | sed s/://) echo "ARTIFACT=$OS" >> $GITHUB_ENV + - name: Install zlib + uses: msys2/setup-msys2@v2 + with: + update: true + install: zlib - uses: actions/checkout@v3 with: repository: ANTsX/ANTs From ba01bf9226dde36b21bc1733281a32c793fa5ea9 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:05:20 -0400 Subject: [PATCH 04/22] `build-ants-windows.yml`: Replace zlib install with cmake flags --- .github/workflows/build-ants-windows.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 4e3c63b..5a398c7 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -27,11 +27,6 @@ jobs: OS="${{ matrix.os }}" OS=$(echo "$OS" | sed s/://) echo "ARTIFACT=$OS" >> $GITHUB_ENV - - name: Install zlib - uses: msys2/setup-msys2@v2 - with: - update: true - install: zlib - uses: actions/checkout@v3 with: repository: ANTsX/ANTs @@ -53,6 +48,8 @@ jobs: -DBUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ + -DZLIB_INCLUDE_DIR=D:\lib\zlib \ + -DZLIB_LIBRARY=D:\lib\zlib\libz.dll.a \ ../ - name: make working-directory: antsbin From ccc0d42c362eaa400663768afaa48047da2af6c7 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:14:35 -0400 Subject: [PATCH 05/22] `build-ants-windows.yml`: DEBUG: Add ls command --- .github/workflows/build-ants-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 5a398c7..35d2f81 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -54,6 +54,7 @@ jobs: - name: make working-directory: antsbin run: | + ls make VERBOSE=1 -j 4 timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build From 6f59111bdba9114041c1cafa4f5ca1db994459cc Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:22:02 -0400 Subject: [PATCH 06/22] `build-ants-windows.yml`: Add '-G "Unix Makefiles"' to generate makefile.txt --- .github/workflows/build-ants-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 35d2f81..51c4d8d 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -44,7 +44,9 @@ jobs: cd antsbin # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 + # NB: `-g "Unix Makefiles"` is needed to generate files for make (https://stackoverflow.com/a/59551107) cmake \ + -G "Unix Makefiles" \ -DBUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ From c242012b1e1e9c27289a238acc6226b1977d0589 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:31:31 -0400 Subject: [PATCH 07/22] Revert "`build-ants-windows.yml`: DEBUG: Add ls command" This reverts commit ccc0d42c362eaa400663768afaa48047da2af6c7. --- .github/workflows/build-ants-windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 51c4d8d..076e5c4 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,7 +56,6 @@ jobs: - name: make working-directory: antsbin run: | - ls make VERBOSE=1 -j 4 timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build From cc3bd751c81a60b672525b434db8a8ced28ae6c0 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:52:18 -0400 Subject: [PATCH 08/22] `build-ants-windows.yml`: DEBUG: Add `-d` to make --- .github/workflows/build-ants-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 076e5c4..63297f4 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,7 +56,7 @@ jobs: - name: make working-directory: antsbin run: | - make VERBOSE=1 -j 4 + make VERBOSE=1 -j 4 -d timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From b8d3ac2c92e1cd93013d95e72c8fe7f68b1f2dc3 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 10:52:34 -0400 Subject: [PATCH 09/22] `build-ants-windows.yml`: DEBUG: Add `-k` to make --- .github/workflows/build-ants-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 63297f4..7abd274 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,7 +56,7 @@ jobs: - name: make working-directory: antsbin run: | - make VERBOSE=1 -j 4 -d + make VERBOSE=1 -j 4 -d -k timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From 8d367332c67dff452723f44d1c1a55d342080b80 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 11:19:07 -0400 Subject: [PATCH 10/22] `build-ants-windows.yml`: DEBUG: Remove `-d` from make --- .github/workflows/build-ants-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 7abd274..9be7b28 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,7 +56,7 @@ jobs: - name: make working-directory: antsbin run: | - make VERBOSE=1 -j 4 -d -k + make VERBOSE=1 -j 4 -k timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From ed5617ace96ab2c24869c52a9dcb5e4ad27307da Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 11:19:24 -0400 Subject: [PATCH 11/22] `build-ants-windows.yml`: Build 'Release' version --- .github/workflows/build-ants-windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 9be7b28..6fddec2 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -45,6 +45,7 @@ jobs: # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 # NB: `-g "Unix Makefiles"` is needed to generate files for make (https://stackoverflow.com/a/59551107) + # NB: `CMAKE_CONFIGURATION_TYPES=Release` is needed on Windows to build the Release version (https://stackoverflow.com/a/20423820) cmake \ -G "Unix Makefiles" \ -DBUILD_TESTING=OFF \ @@ -52,6 +53,8 @@ jobs: -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ -DZLIB_INCLUDE_DIR=D:\lib\zlib \ -DZLIB_LIBRARY=D:\lib\zlib\libz.dll.a \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CONFIGURATION_TYPES=Release \ ../ - name: make working-directory: antsbin From a376189a7ace105f6c80451f579b1ea3aeab242b Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 12:07:10 -0400 Subject: [PATCH 12/22] `build-ants-windows.yml`: Replace `make` with `MSBuild` --- .github/workflows/build-ants-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 6fddec2..9eabe83 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -59,7 +59,7 @@ jobs: - name: make working-directory: antsbin run: | - make VERBOSE=1 -j 4 -k + MSBuild SuperBuild_ANTS.sln timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From e91cb65e5de4f75e5b3a750662bdc037deea4f51 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 12:22:24 -0400 Subject: [PATCH 13/22] `build-ants-windows.yml`: Try `setup-msbuild` --- .github/workflows/build-ants-windows.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 9eabe83..b2f7b99 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,10 +56,14 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CONFIGURATION_TYPES=Release \ ../ + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: x64 - name: make working-directory: antsbin run: | - MSBuild SuperBuild_ANTS.sln + msbuild ALL_BUILD.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From 4b59c556d50aacc19dec433d50266a18434aafdd Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 12:26:36 -0400 Subject: [PATCH 14/22] `build-ants-windows.yml`: Try `cmd` in build step --- .github/workflows/build-ants-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index b2f7b99..57e8213 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -62,6 +62,7 @@ jobs: msbuild-architecture: x64 - name: make working-directory: antsbin + shell: cmd run: | msbuild ALL_BUILD.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release timeout-minutes: 300 From 13f3da402430f93d864ad7de05e8fa76220c16f6 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 12:34:18 -0400 Subject: [PATCH 15/22] `build-ants-windows.yml`: Debug --- .github/workflows/build-ants-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 57e8213..00d1f0e 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -56,14 +56,14 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CONFIGURATION_TYPES=Release \ ../ + ls - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - with: - msbuild-architecture: x64 - name: make working-directory: antsbin shell: cmd run: | + dir msbuild ALL_BUILD.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build From 8f20e618e7b1af6f26d1afb5c8fc1f1b0c56a31c Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 12:40:38 -0400 Subject: [PATCH 16/22] `build-ants-windows.yml`: Remove unix makefiles --- .github/workflows/build-ants-windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 00d1f0e..6b870ac 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -47,7 +47,6 @@ jobs: # NB: `-g "Unix Makefiles"` is needed to generate files for make (https://stackoverflow.com/a/59551107) # NB: `CMAKE_CONFIGURATION_TYPES=Release` is needed on Windows to build the Release version (https://stackoverflow.com/a/20423820) cmake \ - -G "Unix Makefiles" \ -DBUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ From 9f599a0ee2da131b403a41397687cfc914fe519d Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 13:25:51 -0400 Subject: [PATCH 17/22] `build-ants-windows.yml`: Testing different msbuild options --- .github/workflows/build-ants-windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 6b870ac..ba52b17 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -58,12 +58,14 @@ jobs: ls - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: x64 - name: make working-directory: antsbin shell: cmd run: | dir - msbuild ALL_BUILD.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release + msbuild ALL_BUILD.vcxproj -t:all -property:Configuration=Release timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From 4fa9b28b5786c4d39f38759ec5ddea5f7cea9e4c Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 13:30:09 -0400 Subject: [PATCH 18/22] `build-ants-windows.yml`: Testing different msbuild options --- .github/workflows/build-ants-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index ba52b17..294ebf2 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -65,7 +65,7 @@ jobs: shell: cmd run: | dir - msbuild ALL_BUILD.vcxproj -t:all -property:Configuration=Release + msbuild ALL_BUILD.vcxproj -property:Configuration=Release timeout-minutes: 300 # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) From 07a466dc083c61199df19c67ae32d59e9ac08508 Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 14:37:57 -0400 Subject: [PATCH 19/22] Use ANTs version that fetches ITK v5.2.0 This is an attempt to fix https://github.com/spinalcordtoolbox/build_ANTs/pull/3/files#r872663217, but may have unintended consequences for SCT. I'm just trying this out to see how the build goes across our platforms. --- .github/workflows/build-ants-windows.yml | 4 ++-- .github/workflows/build-ants.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 294ebf2..63c251e 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -8,7 +8,7 @@ on: git_ref: description: 'Upstream ANTsX/ANTs commit ref to check out when building' required: true - default: 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' + default: 'bca6205c685784336c0bd17057cd99d8114e3a62' jobs: @@ -32,7 +32,7 @@ jobs: repository: ANTsX/ANTs # NB: This commit mirrors the state of the kousu/ANTs repository # at the time of https://github.com/kousu/ANTs/pull/5. - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} + ref: ${{ github.event.inputs.git_ref || 'bca6205c685784336c0bd17057cd99d8114e3a62' }} # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git - name: Patch in fix for insecure git:// protocol diff --git a/.github/workflows/build-ants.yml b/.github/workflows/build-ants.yml index c75bbed..2fd4226 100644 --- a/.github/workflows/build-ants.yml +++ b/.github/workflows/build-ants.yml @@ -8,7 +8,7 @@ on: git_ref: description: 'Upstream ANTsX/ANTs commit ref to check out when building' required: true - default: 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' + default: 'bca6205c685784336c0bd17057cd99d8114e3a62' jobs: @@ -33,7 +33,7 @@ jobs: repository: ANTsX/ANTs # NB: This commit mirrors the state of the kousu/ANTs repository # at the time of https://github.com/kousu/ANTs/pull/5. - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} + ref: ${{ github.event.inputs.git_ref || 'bca6205c685784336c0bd17057cd99d8114e3a62' }} # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git - name: Patch in fix for insecure git:// protocol @@ -121,7 +121,7 @@ jobs: repository: ANTsX/ANTs # NB: This commit mirrors the state of the kousu/ANTs repository # at the time of https://github.com/kousu/ANTs/pull/5. - ref: ${{ github.event.inputs.git_ref || 'b37e8b56e4e518b0f2947f80d0e3701a5ddfe120' }} + ref: ${{ github.event.inputs.git_ref || 'bca6205c685784336c0bd17057cd99d8114e3a62' }} # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git - name: Patch in fix for insecure git:// protocol From a37d141889b649bc1a5e4bad5ae94e4156e6e55e Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 15:59:58 -0400 Subject: [PATCH 20/22] `build-ants-windows.yml`: Trim `make install` step I don't think this is strictly necessary for our purposes. --- .github/workflows/build-ants-windows.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml index 63c251e..08b166f 100644 --- a/.github/workflows/build-ants-windows.yml +++ b/.github/workflows/build-ants-windows.yml @@ -70,17 +70,11 @@ jobs: # for debugging, don't let a crash/timeout here fail the whole build # (github CI seems glitchy about giving reliable output about what happened on timeouts) continue-on-error: true - - name: pre-package - run: | - mkdir fakeroot/ - cd antsbin/ANTS-build - make VERBOSE=1 -j 4 DESTDIR="../../fakeroot" install - continue-on-error: true - name: package run: | # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much mkdir sct-apps/ - cp antsbin/ANTS-build/Examples/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform} sct-apps + cp antsbin/ANTS-build/Examples/Release/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform}.exe sct-apps (cd sct-apps; for i in `ls`; do mv $i isct_$i; done) cp COPYING.txt sct-apps tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/ From 7567172e212bdc48d03689e437b973a3c51f908e Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 16:03:09 -0400 Subject: [PATCH 21/22] `build-ants-windows.yml`: Fold Windows install into `built-ants.yml` --- .github/workflows/build-ants-windows.yml | 121 ----------------------- .github/workflows/build-ants.yml | 90 ++++++++++++++++- 2 files changed, 89 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/build-ants-windows.yml diff --git a/.github/workflows/build-ants-windows.yml b/.github/workflows/build-ants-windows.yml deleted file mode 100644 index 08b166f..0000000 --- a/.github/workflows/build-ants-windows.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: Build ANTs - -on: - pull_request: - branches: [ master ] - workflow_dispatch: - inputs: - git_ref: - description: 'Upstream ANTsX/ANTs commit ref to check out when building' - required: true - default: 'bca6205c685784336c0bd17057cd99d8114e3a62' - -jobs: - - build: - strategy: - matrix: - os: [ windows-2019 ] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - # first, rewrite OS names to be safe for github artifacts. - - name: names - run: | - OS="${{ matrix.os }}" - OS=$(echo "$OS" | sed s/://) - echo "ARTIFACT=$OS" >> $GITHUB_ENV - - uses: actions/checkout@v3 - with: - repository: ANTsX/ANTs - # NB: This commit mirrors the state of the kousu/ANTs repository - # at the time of https://github.com/kousu/ANTs/pull/5. - ref: ${{ github.event.inputs.git_ref || 'bca6205c685784336c0bd17057cd99d8114e3a62' }} - # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: - # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git - - name: Patch in fix for insecure git:// protocol - run: | - perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake - - name: cmake generate - run: | - mkdir antsbin - cd antsbin - # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it - # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 - # NB: `-g "Unix Makefiles"` is needed to generate files for make (https://stackoverflow.com/a/59551107) - # NB: `CMAKE_CONFIGURATION_TYPES=Release` is needed on Windows to build the Release version (https://stackoverflow.com/a/20423820) - cmake \ - -DBUILD_TESTING=OFF \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ - -DZLIB_INCLUDE_DIR=D:\lib\zlib \ - -DZLIB_LIBRARY=D:\lib\zlib\libz.dll.a \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CONFIGURATION_TYPES=Release \ - ../ - ls - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 - with: - msbuild-architecture: x64 - - name: make - working-directory: antsbin - shell: cmd - run: | - dir - msbuild ALL_BUILD.vcxproj -property:Configuration=Release - timeout-minutes: 300 - # for debugging, don't let a crash/timeout here fail the whole build - # (github CI seems glitchy about giving reliable output about what happened on timeouts) - continue-on-error: true - - name: package - run: | - # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much - mkdir sct-apps/ - cp antsbin/ANTS-build/Examples/Release/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform}.exe sct-apps - (cd sct-apps; for i in `ls`; do mv $i isct_$i; done) - cp COPYING.txt sct-apps - tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/ - continue-on-error: true - - name: results (DEBUG) - run: find . - - name: Upload result - uses: actions/upload-artifact@v2-preview - with: - name: sct-apps_${{ env.ARTIFACT }} - #path: fakeroot/ # this is 2.3G large in this build - path: sct-apps_${{ env.ARTIFACT }}.tar.gz - - release: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # name the release with the run_id to allow multiple builds on the same branch/tag - # https://github.com/actions/create-release/issues/2#issuecomment-613591846 - tag_name: ${{ github.ref }}-${{github.run_id }} - release_name: Release ${{ github.sha }} - draft: true - prerelease: true - - - uses: actions/download-artifact@v1 - with: - name: sct-apps_windows-2019 - continue-on-error: true - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./sct-apps_windows-2019/sct-apps_windows-2019.tar.gz - asset_name: sct-apps_windows-2019.tar.gz - asset_content_type: application/gzip - continue-on-error: true diff --git a/.github/workflows/build-ants.yml b/.github/workflows/build-ants.yml index 2fd4226..bdeb37f 100644 --- a/.github/workflows/build-ants.yml +++ b/.github/workflows/build-ants.yml @@ -182,8 +182,81 @@ jobs: #path: fakeroot/ # this is 2.3G large in this build path: sct-apps_${{ env.ARTIFACT }}.tar.gz + build-windows: + strategy: + matrix: + os: [ windows-2019 ] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + # first, rewrite OS names to be safe for github artifacts. + - name: names + run: | + OS="${{ matrix.os }}" + OS=$(echo "$OS" | sed s/://) + echo "ARTIFACT=$OS" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + repository: ANTsX/ANTs + # NB: This commit mirrors the state of the kousu/ANTs repository + # at the time of https://github.com/kousu/ANTs/pull/5. + ref: ${{ github.event.inputs.git_ref || 'bca6205c685784336c0bd17057cd99d8114e3a62' }} + # The step below sets an option inside the cmake file to use the `https` protocol, which addresses: + # https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git + - name: Patch in fix for insecure git:// protocol + run: | + perl -pi -e 's/http instead." ON\)/http instead." OFF\)/g' SuperBuild.cmake + - name: cmake generate + run: | + mkdir antsbin + cd antsbin + # TODO: check if cmake picks up CMAKE_CXX_FLAGS without being told about it + # NB: `BUILD_TESTING=OFF` fixes https://github.com/ANTsX/ANTs/issues/1236 + # NB: `-g "Unix Makefiles"` is needed to generate files for make (https://stackoverflow.com/a/59551107) + # NB: `CMAKE_CONFIGURATION_TYPES=Release` is needed on Windows to build the Release version (https://stackoverflow.com/a/20423820) + cmake \ + -DBUILD_TESTING=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ + -DZLIB_INCLUDE_DIR=D:\lib\zlib \ + -DZLIB_LIBRARY=D:\lib\zlib\libz.dll.a \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + ../ + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: x64 + - name: make + working-directory: antsbin + shell: cmd + run: | + msbuild ALL_BUILD.vcxproj -property:Configuration=Release + timeout-minutes: 300 + # for debugging, don't let a crash/timeout here fail the whole build + # (github CI seems glitchy about giving reliable output about what happened on timeouts) + continue-on-error: true + - name: package + run: | + # snip out the apps we need for https://github.com/neuropoly/spinalcordtoolbox, since including all of ANTS is too much + mkdir sct-apps/ + cp antsbin/ANTS-build/Examples/Release/{antsRegistration,antsSliceRegularizedRegistration,antsApplyTransforms,ComposeMultiTransform}.exe sct-apps + (cd sct-apps; for i in `ls`; do mv $i isct_$i; done) + cp COPYING.txt sct-apps + tar -zcvf sct-apps_${{ env.ARTIFACT }}.tar.gz sct-apps/ + continue-on-error: true + - name: results (DEBUG) + run: find . + - name: Upload result + uses: actions/upload-artifact@v2-preview + with: + name: sct-apps_${{ env.ARTIFACT }} + path: sct-apps_${{ env.ARTIFACT }}.tar.gz + release: - needs: [build, build-manylinuxes] + needs: [build, build-manylinuxes, build-windows] runs-on: ubuntu-latest steps: - name: Create Release @@ -293,3 +366,18 @@ jobs: asset_name: sct-apps_macos-10.15.tar.gz asset_content_type: application/gzip continue-on-error: true + + - uses: actions/download-artifact@v1 + with: + name: sct-apps_windows-2019 + continue-on-error: true + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./sct-apps_windows-2019/sct-apps_windows-2019.tar.gz + asset_name: sct-apps_windows-2019.tar.gz + asset_content_type: application/gzip + continue-on-error: true From 04a4a586a7c02fb8f3711c78a31203a9dca71cea Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 13 May 2022 16:03:15 -0400 Subject: [PATCH 22/22] Revert "`build-ants.yml`: Comment out workflow trigger to save resources" This reverts commit 579502a977bc5b0f1a5708312fa716f875064132. --- .github/workflows/build-ants.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ants.yml b/.github/workflows/build-ants.yml index bdeb37f..9cb7183 100644 --- a/.github/workflows/build-ants.yml +++ b/.github/workflows/build-ants.yml @@ -1,8 +1,8 @@ name: Build ANTs on: -# pull_request: -# branches: [ master ] + pull_request: + branches: [ master ] workflow_dispatch: inputs: git_ref: