-
Notifications
You must be signed in to change notification settings - Fork 2
653 lines (632 loc) · 24.8 KB
/
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
name: Build
on: [push]
jobs:
build-windows:
name: build-windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe
- name: Install correct Python version
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Pre-install (Windows)
shell: pwsh
run: |
$thirdpartydir="$((Get-Item ..).FullName)\3rdparty"
mkdir $thirdpartydir
- name: Export GitHub Actions cache environment variables for vcpkg
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install NSIS 8192-character limit override
shell: pwsh
run: |
$thirdpartydir="$((Get-Item ..\3rdparty).FullName)"
$zipfile="$thirdpartydir\nsis-8192-overrides.zip"
(New-Object System.Net.WebClient).DownloadFile(
"https://downloads.sourceforge.net/project/nsis/NSIS%203/3.09/nsis-3.09-strlen_8192.zip",$zipfile);
Write-Output "NSIS-8192-override: installing..."
Expand-Archive -Path $zipfile -DestinationPath "C:\Program Files (x86)\NSIS\" -Force
- name: Install thirdparty packages
shell: pwsh
run: scripts\install-3rdparty-full-win1064.ps1
- name: Bootstrap vcpkg
shell: pwsh
run: vcpkg\bootstrap-vcpkg.bat
- name: Install vcpkg packages
shell: pwsh
run: vcpkg\vcpkg.exe install
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
- name: Install Python packages (Windows)
shell: bash
run: |
./scripts/install-3rdparty-win1064.sh
pythonExecutable=`which python`
pythonRoot=`python -c "import sys ; print(sys.prefix)"`
pythonExecutable=`cygpath --windows "$pythonExecutable"`
echo "Python_ROOT_DIR=$pythonRoot" >> $GITHUB_ENV
echo "Python3_EXECUTABLE=$pythonExecutable" >> $GITHUB_ENV
- name: Print Path
shell: pwsh
run: |
$env:path -split ";"
# Works around https://github.com/actions/runner-images/issues/10055
- name: Remove conflicting libraries
shell: bash -l {0}
run: |
find "C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk" -name "msvcp140.dll" -exec rm {} \;
find "C:/Program Files/ImageMagick-7.1.1-Q16-HDRI" -name "msvcp140.dll" -exec rm {} \;
- name: Find where MSVC Redist comes from
if: always()
shell: bash
run: which msvcp140.dll
- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset windows-production -Wno-dev
build-options: --preset windows-production
build-type: Release
run-test: true
install-build: true
ctest-options: -E cwipc_(codec|kinect)_python_tests
# - name: Remove preloading of wrong msvcp140 by matplotlib
# if: always()
# shell: bash
# run:
# find "build/venv" -name ".load-order-matplotlib*" -exec rm {} \;
# - name: Rerun failed tests verbosely
# if: failure()
# shell: bash
# run: |
# ctest --test-dir build -C Release --rerun-failed --output-on-failure
- name: Show Python and Python module versions used
if: always()
shell: bash
run: |
./build/venv/Scripts/python --version
./build/venv/Scripts/python -m pip freeze
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake
ls -l build/package
- name: upload CTest output in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: windows-ctest-output
path: build/Testing/Temporary/LastTest.log
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: windows-build-folder
path: build.tgz
- name: Capture installed folder as artifact
if: false
shell: bash
run: |
7z a cwipc_win1064_${{ github.ref_name }}.zip ../installed/
- name: Upload installed folder
if: false
uses: actions/upload-artifact@v3
with:
name: cwipc_win1064_${{ github.ref_name }}.zip
path: cwipc_win1064_${{ github.ref_name }}.zip
- name: Upload nsis installer
uses: actions/upload-artifact@v3
with:
name: windows-installer.exe
path: build/package/*.exe
- name: Check what was created and installed
if: always()
shell: bash
run: |
ls -l /c
ls -l /c/tools
ls -l "/c/Program Files"
ls -l "/c/Program Files (x86)"
ls -l
ls -l ..
build-macos:
name: build-macos
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe
- name: Install dependencies
shell: bash
run: ./scripts/install-3rdparty-osx1015.sh
env:
HOMEBREW_NO_VERIFY_ATTESTATIONS: "1"
- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset mac-production -Wno-dev
build-options: --preset mac-production
run-test: true
install-build: true
install-options: --prefix ${{ github.workspace }}/installed
- name: Show Python and Python module versions used
if: always()
shell: bash
run: |
./build/venv/bin/python --version
./build/venv/bin/python -m pip freeze
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake
ls -l build/package
- name: upload CTest output in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: macos-ctest-output
path: build/Testing/Temporary/LastTest.log
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: macos-build-folder
path: build.tgz
- name: Capture installed folder as artifact
shell: bash
run: |
tar -c -v -f cwipc_osx1015_${{ github.ref_name }}.tgz -z -C installed .
ls -l
- name: Upload installed folder
uses: actions/upload-artifact@v3
with:
name: cwipc_osx1015_${{ github.ref_name }}.tgz
path: cwipc_osx1015_${{ github.ref_name }}.tgz
build-ubuntu2204:
name: build-ubuntu2204
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe --debug
git describe --tags --debug
- name: Install dependencies
shell: bash
run: ./scripts/install-3rdparty-ubuntu2204.sh
- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset linux-production -Wno-dev
build-options: --preset linux-production
run-test: true
install-build: true
install-options: --prefix ${{ github.workspace }}/installed
- name: Show Python and Python module versions used
if: always()
shell: bash
run: |
./build/venv/bin/python --version
./build/venv/bin/python -m pip freeze
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake -D CPACK_DEBIAN_FILE_NAME="cwipc_${{ github.ref_name }}_ubuntu2204_amd64.deb"
ls -l build/package
- name: upload CTest output in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: linux-ctest-output
path: build/Testing/Temporary/LastTest.log
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: linux-build-folder
path: build.tgz
- name: Capture installed folder as artifact
shell: bash
run: |
tar -c -v -f cwipc_ubuntu2204_${{ github.ref_name }}.tgz -z -C installed .
ls -la
- name: Upload installed folder
uses: actions/upload-artifact@v3
with:
name: cwipc_ubuntu2204_${{ github.ref_name }}.tgz
path: cwipc_ubuntu2204_${{ github.ref_name }}.tgz
- name: Upload debian package
uses: actions/upload-artifact@v3
with:
name: debian-package-2204.deb
path: build/package/*.deb
- name: Upload cached git version
uses: actions/upload-artifact@v3
with:
name: cached-git-version
path: .cachedgitversion.txt
if-no-files-found: error
include-hidden-files: true
build-android:
name: build-android
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe --debug
git describe --tags --debug
- name: Free some space
run: |
df -h
# Remove software and language runtimes we're not using
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h
- name: Install Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27b
add-to-path: true
- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset android-production -Wno-dev
build-options: --preset android-production
run-test: false
install-build: false
install-options: --prefix ${{ github.workspace }}/installed
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake -D CPACK_PACKAGE_FILE_NAME="cwipc_${{ github.ref_name }}_android_arm64"
ls -l build/package
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: android-build-folder
path: build.tgz
- name: Upload installer package
uses: actions/upload-artifact@v3
with:
name: android-arm64-package
path: build/package/*.tar.gz
build-ubuntu2404:
name: build-ubuntu2404
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe --debug
git describe --tags --debug
- name: Install dependencies
shell: bash
run: ./scripts/install-3rdparty-ubuntu2404.sh
- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset linux-production -Wno-dev
build-options: --preset linux-production
run-test: true
install-build: true
install-options: --prefix ${{ github.workspace }}/installed
- name: Show Python and Python module versions used
if: always()
shell: bash
run: |
./build/venv/bin/python --version
./build/venv/bin/python -m pip freeze
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake -D CPACK_DEBIAN_FILE_NAME="cwipc_${{ github.ref_name }}_ubuntu2404_amd64.deb"
ls -l build/package
- name: upload CTest output in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: linux-ctest-output
path: build/Testing/Temporary/LastTest.log
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: linux-build-folder
path: build.tgz
- name: Capture installed folder as artifact
shell: bash
run: |
tar -c -v -f cwipc_ubuntu2404_${{ github.ref_name }}.tgz -z -C installed .
ls -la
- name: Upload installed folder
uses: actions/upload-artifact@v3
with:
name: cwipc_ubuntu2404_${{ github.ref_name }}.tgz
path: cwipc_ubuntu2404_${{ github.ref_name }}.tgz
- name: Upload debian package
uses: actions/upload-artifact@v3
with:
name: debian-package-2404.deb
path: build/package/*.deb
- name: Upload cached git version
uses: actions/upload-artifact@v3
with:
name: cached-git-version
path: .cachedgitversion.txt
if-no-files-found: error
include-hidden-files: true
create-release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: create-release
runs-on: ubuntu-latest
needs:
- build-windows
- build-macos
- build-ubuntu2204
- build-ubuntu2404
- build-android
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe
- name: Download cached git version
uses: actions/download-artifact@v3
with:
name: cached-git-version
path: .
- name: Create Assets and full sourcecode assets
shell: bash
run: |
mkdir ../Assets
tar -c -f ../Assets/${{ github.ref_name }}-complete.tar.gz --exclude-vcs .
zip -x '*.git*' -r ../Assets/${{ github.ref_name }}-complete.zip .
awk '/^## /{if(flag){exit}; flag=1} flag' CHANGELOG.md > ../Assets/changes.md
- name: Download Windows installed folder
if: false
uses: actions/download-artifact@v3
with:
name: cwipc_win1064_${{ github.ref_name }}.zip
path: ../Assets/
- name: Download MacOS installed folder
uses: actions/download-artifact@v3
with:
name: cwipc_osx1015_${{ github.ref_name }}.tgz
path: ../Assets/
- name: Download Ubuntu 22.04 installed folder
uses: actions/download-artifact@v3
with:
name: cwipc_ubuntu2204_${{ github.ref_name }}.tgz
path: ../Assets/
- name: Download debian package for 22.04
uses: actions/download-artifact@v3
with:
name: debian-package-2204.deb
path: ../Assets/
- name: Download Ubuntu 24.04 installed folder
uses: actions/download-artifact@v3
with:
name: cwipc_ubuntu2404_${{ github.ref_name }}.tgz
path: ../Assets/
- name: Download debian package for 24.04
uses: actions/download-artifact@v3
with:
name: debian-package-2404.deb
path: ../Assets/
- name: Download Windows installer
uses: actions/download-artifact@v3
with:
name: windows-installer.exe
path: ../Assets/
- name: Download Android installer
uses: actions/download-artifact@v3
with:
name: android-arm64-package
path: ../Assets/
- name: Find Artefact names
run: |
windows_exe_path=$(ls ../Assets/*.exe | head -n 1)
ubuntu2204_deb_path=$(ls ../Assets/*2204*.deb | head -n 1)
ubuntu2404_deb_path=$(ls ../Assets/*2404*.deb | head -n 1)
echo "windows_exe_path=${windows_exe_path}" >> $GITHUB_ENV
echo "ubuntu2204_deb_path=${ubuntu2204_deb_path}" >> $GITHUB_ENV
echo "ubuntu2404_deb_path=${ubuntu2404_deb_path}" >> $GITHUB_ENV
- name: Check what is there
shell: bash
run: ls -l . ../Assets
- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
draft: false
prerelease: true
release_name: ${{ github.ref }}
tag_name: ${{ github.ref }}
body_path: ../Assets/changes.md
- name: Upload Windows installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.windows_exe_path }}
asset_name: cwipc-win1064-${{ github.ref_name }}.exe
asset_content_type: application/gzip
- name: Upload Ubuntu 22.04 debian package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ubuntu2204_deb_path }}
asset_name: cwipc-ubuntu2204-${{ github.ref_name }}.deb
asset_content_type: application/gzip
- name: Upload Ubuntu 24.04 debian package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ubuntu2404_deb_path }}
asset_name: cwipc-ubuntu2404-${{ github.ref_name }}.deb
asset_content_type: application/gzip
- name: Upload complete source (gzipped tar)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/${{ github.ref_name }}-complete.tar.gz
asset_name: cwipc-${{ github.ref_name }}-source-including-submodules.tar.gz
asset_content_type: application/zip
- name: Upload Android package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_${{ github.ref_name }}_android_arm64.tar.gz
asset_name: cwipc_${{ github.ref_name }}_android_arm64.tar.gz
asset_content_type: application/zip
- name: Upload complete source (zip)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/${{ github.ref_name }}-complete.zip
asset_name: cwipc-${{ github.ref_name }}-source-including-submodules.zip
asset_content_type: application/zip
- name: Upload Windows installed folder
if: false
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_win1064_${{ github.ref_name }}.zip
asset_name: cwipc-win10-${{ github.ref_name }}-built.zip
asset_content_type: application/zip
- name: Upload MacOS installed folder
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_osx1015_${{ github.ref_name }}.tgz
asset_name: cwipc-macos1014-intel-${{ github.ref_name }}-built.tgz
asset_content_type: application/gzip
- name: Upload Ubuntu 22.04 installed folder
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_ubuntu2204_${{ github.ref_name }}.tgz
asset_name: cwipc-ubuntu2204-${{ github.ref_name }}-built.tgz
asset_content_type: application/gzip
- name: Upload Ubuntu 24.04 installed folder
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_ubuntu2404_${{ github.ref_name }}.tgz
asset_name: cwipc-ubuntu2404-${{ github.ref_name }}-built.tgz
asset_content_type: application/gzip