-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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/[email protected] | ||
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 |