-
Notifications
You must be signed in to change notification settings - Fork 155
279 lines (263 loc) · 10.3 KB
/
windows_build.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# This is a basic workflow to help you get started with Actions
name: Windows builds
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
paths-ignore:
- '**/README.md'
pull_request:
branches: [master]
paths-ignore:
- '**/README.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
windows_build:
# The type of runner that the job will run on
runs-on: windows-2019
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
matrix:
include:
- VS_VERSION: Visual Studio 16
VS_VER: 2019
MSVC_VER: 1920
platform: x64
- VS_VERSION: Visual Studio 16
VS_VER: 2019
MSVC_VER: 1920
platform: x86
env:
VS_VERSION: ${{ matrix.VS_VERSION }}
VS_VER: ${{ matrix.VS_VER }}
MSVC_VER: ${{ matrix.MSVC_VER }}
platform: ${{ matrix.platform }}
APPVEYOR: true # to skip some tests
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # see https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Set environment
- name: Set environment
shell: pwsh
run: |
if($env:platform -eq "x86")
{
$env:ARCHITECTURE="x86"
$env:WIN64_ARG=""
$env:CMAKE_ARCHITECTURE="Win32"
}
else
{
$env:ARCHITECTURE="amd64"
$env:WIN64_ARG="WIN64=YES"
$env:CMAKE_ARCHITECTURE="x64"
}
echo "::set-env name=PATH::$env:PATH"
echo "::set-env name=ARCHITECTURE::$env:ARCHITECTURE"
echo "::set-env name=WIN64_ARG::$env:WIN64_ARG"
# Set compiler environment
- name: Set compiler environment
shell: cmd
run: |
if "%VS_VER%" == "2019" CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=%ARCHITECTURE%
echo ::set-env name=PATH::%PATH%
echo ::set-env name=INCLUDE::%INCLUDE%
echo ::set-env name=LIB::%LIB%
echo ::set-env name=LIBPATH::%LIBPATH%
- uses: actions/cache@v3
id: cache
with:
path: |
BuildTools/windows/libraries
BuildTools/windows/temp
key: ${{ runner.os }}-${{ matrix.platform }}-deps-cache-${{ hashFiles('BuildTools/windows/deps.md') }}
# Install innosetup
- name: Install innosetup
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install innosetup --no-progress
# Create Deps
- if: steps.cache.outputs.cache-hit != 'true'
name: Create Dependencies
shell: pwsh
run: |
$ErrorActionPreference = 'continue'
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
echo "ARCH_FLAGS = $env:ARCH_FLAGS"
Import-PackageProvider NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# install pscx powershell and vSSetup
Install-Module Pscx -AllowClobber
Install-Module VSSetup -Scope CurrentUser
if($env:VS_VER -eq "2019")
{
}
else
{
Import-VisualStudioVars -VisualStudioVersion $env:VS_VER -Architecture $env:ARCHITECTURE
}
#
# prepare
#
$env:GDA_PATH="$env:GITHUB_WORKSPACE\BuildTools\windows"
cd $env:GDA_PATH
mkdir temp
#
# GDAL # gisinternals SDK version still to 2016
#
if($env:platform -eq "x86")
{
$env:GDAL_SDK_VER="release-1911"
}
else
{
$env:GDAL_SDK_VER="release-1911-x64"
}
cd temp
Invoke-WebRequest "https://github.com/GeoDaCenter/software/releases/download/v2000/$env:GDAL_SDK_VER-dev.zip" -OutFile "$env:GDAL_SDK_VER.zip"
cd ..
7z x .\temp\$env:GDAL_SDK_VER.zip
dir
Rename-Item $env:GDAL_SDK_VER libraries
cd temp
#
# wxWidgets 3.1.4
#
if(-Not (Test-Path -Path wxWidgets.zip)) { Invoke-WebRequest "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.zip" -OutFile "wxWidgets.zip" }
7z x wxWidgets.zip -owxWidgets
cd wxWidgets
xcopy /E /Y $env:GDA_PATH\dep\wxWidgets .
cd build\msw
if($env:platform -eq "x86")
{
nmake -f makefile.vc UNICODE=1 SHARED=1 RUNTIME_LIBS=dynamic BUILD=release MONOLITHIC=1 USE_OPENGL=1 USE_POSTSCRIPT=1
}
else
{
nmake -f makefile.vc UNICODE=1 SHARED=1 RUNTIME_LIBS=dynamic BUILD=release MONOLITHIC=1 USE_OPENGL=1 USE_POSTSCRIPT=1 TARGET_CPU=AMD64
}
cd $env:GDA_PATH\temp
#
# Boost 1.75
#
Invoke-WebRequest "https://github.com/lixun910/pygeoda_boost/archive/refs/tags/v1.18.zip" -OutFile "boost.zip"
7z x boost.zip
Rename-Item pygeoda_boost-1.18 boost
#
# JSON Spirit v4.08
#
if(-Not (Test-Path -Path json_spirit_v4.08.zip )) { Invoke-WebRequest "https://github.com/GeoDaCenter/software/releases/download/v2000/json_spirit_v4.08.zip" -OutFile "json_spirit_v4.08.zip" }
if(-Not (Test-Path -Path json_spirit_v4.08)) { 7z x json_spirit_v4.08.zip }
cd json_spirit_v4.08
xcopy /E /Y $env:GDA_PATH\dep\json_spirit .
if($env:platform -eq "x86")
{
msbuild.exe json_vs2019.sln /property:Configuration="Release" /p:Platform="Win32"
}
else
{
msbuild.exe json_vs2019.sln /property:Configuration="Release" /p:Platform="x64"
}
cd ..
#
# CLAPACK 3.1.1
#
Invoke-WebRequest "https://github.com/GeoDaCenter/software/releases/download/v2000/CLAPACK-3.1.1-VisualStudio.zip" -OutFile "CLAPACK-3.1.1-VisualStudio.zip"
7z x CLAPACK-3.1.1-VisualStudio.zip
cd CLAPACK-3.1.1-VisualStudio
xcopy /E /Y $env:GDA_PATH\dep\CLAPACK-3.1.1-VisualStudio .
if($env:platform -eq "x86")
{
msbuild.exe clapack_vs2019.sln /t:libf2c_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="Win32"
msbuild.exe clapack_vs2019.sln /t:BLAS\blas_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="Win32"
msbuild.exe clapack_vs2019.sln /t:clapack_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="Win32"
}
else
{
msbuild.exe clapack_vs2019.sln /t:libf2c_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="x64"
msbuild.exe clapack_vs2019.sln /t:BLAS\blas_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="x64"
msbuild.exe clapack_vs2019.sln /t:clapack_vs2019 /property:Configuration="ReleaseDLL" /p:Platform="x64"
}
cd ..
#
# Eigen3
#
Invoke-WebRequest "https://github.com/GeoDaCenter/software/releases/download/v2000/eigen3.zip" -OutFile "eigen3.zip"
7z x eigen3.zip
#
# Spectra v0.8.0
#
Invoke-WebRequest "https://github.com/yixuan/spectra/archive/refs/tags/v0.8.0.zip" -OutFile "spectra.zip"
7z x spectra.zip
Rename-Item spectra-0.8.0 spectra
#
# OpenCL
#
Invoke-WebRequest "https://github.com/GeoDaCenter/software/releases/download/v2000/OpenCL.zip" -OutFile "OpenCL.zip"
7z x OpenCL.zip
dir
cd ..
# Build GeoDa
- name: Build GeoDa
shell: pwsh
run: |
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
echo "ARCH_FLAGS = $env:ARCH_FLAGS"
Import-PackageProvider NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# install pscx powershell and vSSetup
Install-Module Pscx -AllowClobber
Install-Module VSSetup -Scope CurrentUser
if($env:VS_VER -eq "2019")
{
}
else
{
Import-VisualStudioVars -VisualStudioVersion $env:VS_VER -Architecture $env:ARCHITECTURE
}
$ErrorActionPreference = 'continue'
$env:GDA_PATH="$env:GITHUB_WORKSPACE\BuildTools\windows"
cd $env:GDA_PATH
if($env:platform -eq "x86")
{
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /m /p:Platform="Win32"
}
else
{
msbuild.exe GeoDa.vs2019.sln /t:GeoDa /property:Configuration="Release" /m /p:Platform="x64"
}
if($env:platform -eq "x86")
{
ISCC.exe /q installer\32bit\GeoDa.iss
ISCC.exe /q installer\32bit\GeoDa-win7+.iss
}
else
{
ISCC.exe /q installer\64bit\GeoDa.iss
ISCC.exe /q installer\64bit\GeoDa-win7+.iss
}
dir
- uses: actions/upload-artifact@v3
with:
name: GeoDa-Windows-${{ env.platform }}-installer
path: ${{ github.workspace }}\BuildTools\windows\GeoDa_1.22_${{ env.platform }}_Setup.exe
- uses: actions/upload-artifact@v3
with:
name: GeoDa-Windows7+-${{ env.platform }}-installer
path: ${{ github.workspace }}\BuildTools\windows\GeoDa_1.22_win7+${{ env.platform }}_Setup.exe