-
-
Notifications
You must be signed in to change notification settings - Fork 103
296 lines (259 loc) · 10.4 KB
/
Copy pathbuild-windows-legacy.yml
File metadata and controls
296 lines (259 loc) · 10.4 KB
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
name: Build Legacy Windows version (xp)
permissions:
contents: read
on:
workflow_call:
inputs:
architecture:
type: string
description: 'Architecture to build'
required: true
default: 'x64'
version:
type: string
description: 'Version to build'
required: true
secrets:
AZURE_TENANT_ID:
description: 'Azure tenant ID'
required: true
AZURE_CLIENT_ID:
description: 'Azure client ID'
required: true
AZURE_CLIENT_SECRET:
description: 'Azure client secret'
required: true
env:
PYTHON_VERSION: 3.11
OPENSSL_VERSION: 3.5.4
PROTOBUF_VERSION: 21.12
BOOST_VERSION: 1.86.0
CRYPTOPP_VERSION: 8.9.0
LUA_VERSION: 5.4.8
TINY_XML_2_VERSION: 10.1.0
GOOGLE_TEST_VERSION: 1.12.1
MONGOOSE_VERSION: "7.20"
MINIZ_VERSION: "3.1.1"
jobs:
build:
runs-on: windows-latest
outputs:
platform: ${{ steps.setup.outputs.platform }}
steps:
- uses: actions/checkout@v6
- id: setup
run: |
if ("${{ inputs.architecture }}" -eq "x64") {
echo "msvc_arch=x64" >> $env:GITHUB_OUTPUT
echo "platform=x64" >> $env:GITHUB_OUTPUT
} else {
echo "msvc_arch=amd64_x86" >> $env:GITHUB_OUTPUT
echo "platform=Win32" >> $env:GITHUB_OUTPUT
}
shell: pwsh
- id: python
uses: actions/setup-python@v6
with:
python-version: ${{ ENV.PYTHON_VERSION }}
architecture: ${{ inputs.architecture }}
cache-dependency-path: 'build/python/requirements.txt'
cache: 'pip'
- uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
cache-dependency-path: web/package-lock.json
- id: build-web
working-directory: web
run: |
npm install
npm run build
- name: Install components
uses: ./.github/actions/update-msvc
- uses: ilammy/msvc-dev-cmd@v1
name: Setup msvc environment
with:
toolset: "14.1"
arch: ${{ steps.setup.outputs.msvc_arch }}
- name: make dirs
run: |
mkdir tmp
mkdir tmp\nscp
mkdir tmp\installer_lib
shell: cmd
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: 'latest'
distribution: strawberry
- name: setup python dependencies
run: |
& "$env:Python_ROOT_DIR\Scripts\pip" install -r build/python/requirements.txt
- id: google-test
uses: ./.github/actions/google-test
with:
version: ${{ env.GOOGLE_TEST_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: 'static'
toolset: v141_xp
target_folder: './tmp/nscp'
- id: openssl
uses: ./.github/actions/openssl
with:
version: ${{ ENV.OPENSSL_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: 'static'
- id: protobuf
uses: ./.github/actions/protobuf
with:
version: ${{ ENV.PROTOBUF_VERSION }}
architecture: ${{ inputs.architecture }}
runtime: static
toolset: v141_xp
support_xp: 'true'
- id: cryptopp
uses: ./.github/actions/cryptopp
with:
version: ${{ ENV.CRYPTOPP_VERSION }}
architecture: ${{ inputs.architecture }}
toolset: v141_xp
runtime: 'static'
- id: lua
uses: ./.github/actions/lua
with:
version: ${{ ENV.LUA_VERSION }}
- id: tinyxml2
uses: ./.github/actions/tinyxml2
with:
version: ${{ ENV.TINY_XML_2_VERSION }}
- id: mongoose
uses: ./.github/actions/mongoose
with:
version: ${{ ENV.MONGOOSE_VERSION }}
- id: miniz
uses: ./.github/actions/miniz
with:
version: ${{ ENV.MINIZ_VERSION }}
- name: Build Boost (static)
id: static_boost
uses: mickem/build-boost@42c59d10fc12f919a986f7e1c2f7c752d4960190
with:
version: ${{ ENV.BOOST_VERSION }}
libraries: system filesystem thread regex date_time program_options python chrono json
platform: ${{ inputs.architecture }}
configuration: Release
static: 1
static-runtime: 1
directory: ${{ runner.workspace }}/static_boost
toolset: msvc141
defines: _USING_V110_SDK71_ BOOST_USE_WINAPI_VERSION=0x501 BOOST_NO_CXX17_HDR_SHARED_MUTEX
- id: paths
run: |
$path_unix="${{ steps.static_boost.outputs.root }}".replace('\','/')
echo "static_boost_root=$path_unix" >> $env:GITHUB_OUTPUT
$path_unix="${{ steps.static_boost.outputs.librarydir }}".replace('\','/')
echo "static_boost_librarydir=$path_unix" >> $env:GITHUB_OUTPUT
$path_unix="${{ env.Python_ROOT_DIR }}".replace('\','/')
echo "python_path=$path_unix" >> $env:GITHUB_OUTPUT
shell: pwsh
- uses: DamianReeves/write-file-action@master
name: Write NSClient++ cmake config
with:
path: tmp/nscp/build.cmake
contents: |
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_LIBS ON)
SET(USE_STATIC_RUNTIME TRUE)
SET(NSCP_BOOST_PYTHON_VERSION "python311")
SET(LIBRARY_ROOT_FOLDER "${{ env.GITHUB_WORKSPACE }}")
SET(BOOST_ROOT "${{ steps.paths.outputs.static_boost_root }}")
SET(BOOST_LIBRARYDIR "${{ steps.paths.outputs.static_boost_librarydir }}")
SET(PROTOBUF_ROOT "${{ steps.protobuf.outputs.path_unix }}")
SET(PROTOBUF_LIBRARYDIR "${PROTOBUF_ROOT}/build/Release")
SET(OPENSSL_ROOT_DIR "${{ steps.openssl.outputs.path_unix }}")
SET(OPENSSL_USE_STATIC_LIBS TRUE)
SET(LUA_SOURCE_ROOT "${{ steps.lua.outputs.path_unix }}")
SET(Python3_ROOT_DIR "${{ steps.paths.outputs.python_path }}")
SET(Python3_FIND_STRATEGY LOCATION)
SET(CRYPTOPP_ROOT "${{ steps.cryptopp.outputs.path_unix }}")
SET(TINY_XML2_SOURCE_DIR "${{ steps.tinyxml2.outputs.path_unix }}")
set(GTEST_ROOT "${{ steps.google-test.outputs.path_unix }}")
set(MONGOOSE_SOURCE_DIR "${{ steps.mongoose.outputs.path_unix }}")
set(MINIZ_INCLUDE_DIR "${{ steps.miniz.outputs.path_unix }}")
set(CHECK_NSCLIENT_MISSING TRUE)
- name: Make python dist
working-directory: tmp/nscp
run: |
& "$env:Python_ROOT_DIR\python" ..\..\build\python\mk_pyzip.py --source ${{ env.Python_ROOT_DIR }} --version python${{ replace(env.PYTHON_VERSION, '.', '') }}
shell: pwsh
- name: CMake (installer_lib)
working-directory: tmp/installer_lib
run: |
cmake ../../installer_lib -T v141_xp -G "Visual Studio 17" -A ${{ steps.setup.outputs.platform }} -DBOOST_ROOT=${{ steps.paths.outputs.static_boost_root }} -DBOOST_LIBRARYDIR=${{ steps.paths.outputs.static_boost_librarydir }} -DOPENSSL_ROOT_DIR=${{ steps.openssl.outputs.path_unix }} -DBUILD_VERSION=${{ inputs.version }}
- name: Build installer_lib
working-directory: tmp/installer_lib
run: |
msbuild installer_lib.sln /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
- name: CMake (NSCP)
working-directory: tmp/nscp
run: |
cmake ../.. -T v141_xp -G "Visual Studio 17" -A ${{ steps.setup.outputs.platform }} -D BUILD_VERSION=${{ inputs.version }} -D CRT_MERGE_MODULE_NAME=Microsoft_VC143_CRT
- name: Build nsclient
working-directory: tmp/nscp
run: |
msbuild NSCP.sln /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }}
- name: Run tests
working-directory: tmp/nscp
run: |
ctest --output-on-failure -C Release
- name: Sign binaries
if: github.actor != 'dependabot[bot]'
uses: ./.github/actions/sign-windows-binaries
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Build installer
working-directory: tmp/nscp
run: |
msbuild installers\installer-NSCP\installer_NSCP.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false
- name: Post process files
uses: ./.github/actions/post-process-windows-binaries
with:
version: ${{ inputs.version }}
platform: ${{ steps.setup.outputs.platform }}
suffix: '-legacy-xp'
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
signing-enabled: ${{ github.actor != 'dependabot[bot]' }}
- uses: actions/upload-artifact@v6
with:
name: NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp
path: |
tmp/nscp/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp-docs.zip
tmp/nscp/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp.zip
tmp/nscp/installers/installer-NSCP/NSCP-${{ inputs.version }}-${{ steps.setup.outputs.platform }}-legacy-xp.msi
tmp/nscp/NSCP-${{ inputs.version }}-${{ inputs.platform }}-legacy-xp-symbols.zip
if-no-files-found: error
- name: Add versions
shell: bash
run: |
echo "| Library | Version |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Boost | ${{ env.BOOST_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Cryptopp | ${{ env.CRYPTOPP_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Lua | ${{ env.LUA_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| OpenSSL | ${{ env.OPENSSL_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Protobuf | ${{ env.PROTOBUF_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| TinyXml2 | ${{ env.TINY_XML_2_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Mongoose | ${{ env.MONGOOSE_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Miniz | ${{ env.MINIZ_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Python | ${{ env.PYTHON_VERSION }} |" >> $GITHUB_STEP_SUMMARY
integration-tests:
needs: build
uses: ./.github/workflows/integration-tests-windows.yml
with:
architecture: ${{ inputs.architecture }}
version: ${{ inputs.version }}
artifact-name: NSCP-${{ inputs.version }}-${{ needs.build.outputs.platform }}-legacy-xp
platform: ${{ needs.build.outputs.platform }}-legacy-xp