-
Notifications
You must be signed in to change notification settings - Fork 32
170 lines (136 loc) · 5.96 KB
/
build-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Windows Build
on:
push:
branches:
- master
- release_v*
tags:
- '*'
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
SW_CLOUD_LOGIN: ${{ secrets.CLOUD_LOGIN }}
CACHE_HOST: ${{ secrets.SSH_HOST }}
GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-2019
steps:
- name: Add to path
shell: bash -l {0}
run: echo "C:\Miniconda\condabin" >> $GITHUB_PATH
- name: Check path
shell: bash -l {0}
run: echo "$PATH"
- name: Init conda
shell: bash -l {0}
run: /c/Miniconda/condabin/conda.bat init --all
# - name: link
# shell: bash -l {0}
# run: cd /usr/bin && ln -s /c/Miniconda/condabin/conda.bat conda
# - name: Check Conda
# shell: bash -l {0}
# run: /c/Miniconda/condabin/conda.bat info
# - name: Check path
# shell: bash -l {0}
# run: ls /c/Miniconda/condabin
# - name: Check path
# shell: bash -l {0}
# run: which conda.bat
- name: Check Conda
shell: bash -l {0}
run: conda info
# - name: Setup Conda
# uses: conda-incubator/[email protected]
# with:
# miniconda-version: 'latest'
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: true
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Download test data
shell: bash -l {0}
run: .github/workflows/download_test_data.sh
- name: Get NSIS
working-directory: ${{runner.workspace}}
run: |
curl -o nsis.zip https://www.sci.utah.edu/~amorris/NSISPortable_3.04.zip
Expand-Archive -LiteralPath nsis.zip -DestinationPath .
- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
- name: Build Dependencies
shell: bash -l {0}
run: .github/workflows/gha_deps.sh
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory "C:/build"
- name: Check Disk Space1
working-directory: ${{runner.workspace}}
shell: bash -l {0}
run: df -h
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash -l {0}
working-directory: "C:/build"
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: conda activate shapeworks && cmake $GITHUB_WORKSPACE -DCMAKE_CXX_FLAGS="-FS" -DCMAKE_C_FLAGS="-FS" -DCMAKE_CXX_FLAGS_RELEASE="-FS /Zm500 /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_C_FLAGS_RELEASE="-FS /Zi /GL /MD /O2 /Ob3 /DNDEBUG /EHsc" -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-LTCG /DEBUG" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DITK_DIR="C:\deps\lib\cmake\ITK-5.3" -DVTK_DIR="C:\deps\lib\cmake\vtk-9.1" -DXLNT_DIR="C:\deps" -DLIBIGL_DIR="C:\deps" -DJKQTCommonSharedLib_DIR="C:/deps/lib/cmake/JKQTCommonSharedLib" -DJKQTMathTextSharedLib_DIR="C:/deps/lib/cmake/JKQTMathTextSharedLib" -DJKQTPlotterSharedLib_DIR="C:/deps/lib/cmake/JKQTPlotterSharedLib" -DOpenVDB_DIR="C:\deps\lib\cmake\OpenVDB" -DGEOMETRYCENTRAL_DIR="C:\deps" -DACVD_DIR="C:\deps" -DBuild_Studio=ON -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET
- name: Build
working-directory: "C:/build"
shell: bash -l {0}
# Execute the build. You can specify a specific target with "--target <NAME>"
run: conda activate shapeworks && cmake --build . --config $BUILD_TYPE --parallel
- name: Check Disk Space2
working-directory: ${{runner.workspace}}
shell: bash -l {0}
run: df -h
- name: Copy Libraries
working-directory: "C:/build"
run: xcopy /f C:\deps\bin\*.dll C:\build\bin\Release
- name: Build Binary Package
shell: bash -l {0}
env:
PR_NUMBER: ${{ github.event.number }}
run: conda activate shapeworks && source ${GITHUB_WORKSPACE}/devenv.sh ./bin/Release && pwd ; ls ; cp docs/users/Windows_README.txt . ; cp Support/shapeworks.nsi . ; conda activate shapeworks && source ${GITHUB_WORKSPACE}/devenv.sh ./bin/Release && ./Support/package_windows.sh tag
- name: Check Disk Space3
working-directory: ${{runner.workspace}}
shell: bash -l {0}
run: df -h
- name: Download test data
shell: bash -l {0}
run: .github/workflows/download_test_data.sh
- name: Test
working-directory: "C:/build"
shell: bash -l {0}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: conda activate shapeworks && source ${GITHUB_WORKSPACE}/devenv.sh ./bin/Release && ctest --output-on-failure -VV -C $BUILD_TYPE --debug
- uses: actions/upload-artifact@v4
with:
name: artifact-${{github.sha}}-windows
path: ${{runner.workspace}}\ShapeWorks\artifacts
- name: Check Disk Space4
working-directory: ${{runner.workspace}}
shell: bash -l {0}
run: df -h
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev-windows"
prerelease: true
title: "Development Build for Windows"
files: |
d:/a/ShapeWorks/ShapeWorks/artifacts/*.exe