Skip to content

Commit

Permalink
Merge 04a4a58 into cad531d
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacwnewton authored May 13, 2022
2 parents cad531d + 04a4a58 commit b520563
Showing 1 changed file with 92 additions and 4 deletions.
96 changes: 92 additions & 4 deletions .github/workflows/build-ants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit b520563

Please sign in to comment.