-
Notifications
You must be signed in to change notification settings - Fork 219
594 lines (506 loc) 路 20.8 KB
/
Copy pathbuild-windows.yml
File metadata and controls
594 lines (506 loc) 路 20.8 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
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
name: Build Windows
on:
push:
pull_request:
branches:
- master
env:
IS_JENKINS_SIGNING_ALLOWED: true
jobs:
build-windows:
runs-on: windows-2022
env:
# enable starting Qt GUI Applications
QT_QPA_PLATFORM: offscreen
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
setup-python: 'true'
version: '6.6.*'
target: 'desktop'
arch: 'win64_msvc2019_64'
archives: 'qtbase qtsvg'
cache: 'true'
- name: Install doxygen
# Pin to latest doxygen version.
run: choco install doxygen.install --version=1.13.2
- name: Install ccache
run: choco install ccache --version=4.11.2
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'false'
fetch-depth: 0
filter: 'tree:0' # Download all commits but blobs and trees on demand
- name: Update / download Submodules (selected ones)
run: |
git submodule update --init
shell: cmd
- name: Create Python virtualenv
run: |
mkdir "${{ runner.workspace }}\_build\complete\.venv\"
py -3.11 -m venv "${{ runner.workspace }}\.venv"
CALL "${{ runner.workspace }}\.venv\Scripts\activate.bat"
echo Upgrading pip
python -m pip install --upgrade pip
pip install wheel
echo Installing python requirements
pip install -r "%GITHUB_WORKSPACE%\doc\requirements.txt"
shell: cmd
# Using ccache on Windows requires the Ninja generator
# This action calls vcvarsall for us to setup the desired toolchain
- name: Setup MSVC toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: 14.29 # v142 / vs2019
- name: Prepare ccache and restore cache
id: ccache_cache-restore
uses: ./.github/actions/ccache-prepare
with:
key-root: windows-2019
cache-dir: ${{ github.workspace }}/.ccache
- name: CMake SDK
run: |
mkdir "${{ runner.workspace }}\_build\sdk\"
cd "${{ runner.workspace }}/_build/sdk"
cmake %GITHUB_WORKSPACE% -G "Ninja" ^
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^
-DECAL_USE_HDF5=ON ^
-DECAL_USE_QT=ON ^
-DECAL_USE_CURL=OFF ^
-DECAL_USE_CAPNPROTO=OFF ^
-DECAL_USE_FTXUI=ON ^
-DECAL_BUILD_DOCS=OFF ^
-DECAL_BUILD_APPS=OFF ^
-DECAL_BUILD_APP_SDK=ON ^
-DECAL_BUILD_SAMPLES=OFF ^
-DECAL_BUILD_TIMEPLUGINS=ON ^
-DECAL_BUILD_PY_BINDING=OFF ^
-DECAL_BUILD_CSHARP_BINDING=OFF ^
-DECAL_BUILD_TESTS=OFF ^
-DECAL_INSTALL_SAMPLE_SOURCES=OFF ^
-DECAL_USE_NPCAP=ON ^
-DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^
-DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^
-DECAL_THIRDPARTY_BUILD_ABSL=ON ^
-DECAL_THIRDPARTY_BUILD_SPDLOG=ON ^
-DECAL_THIRDPARTY_BUILD_TINYXML2=ON ^
-DECAL_THIRDPARTY_BUILD_FINEFTP=OFF ^
-DECAL_THIRDPARTY_BUILD_CURL=OFF ^
-DECAL_THIRDPARTY_BUILD_GTEST=OFF ^
-DECAL_THIRDPARTY_BUILD_HDF5=ON ^
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=OFF ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^
-DCMAKE_BUILD_TYPE=Debug ^
-DECAL_CPACK_PACK_WITH_INNOSETUP=OFF
shell: cmd
- name: CMake Complete
id: cmake-configure
run: |
CALL "${{ runner.workspace }}\.venv\Scripts\activate.bat"
cd "${{ runner.workspace }}/_build/complete"
cmake %GITHUB_WORKSPACE% -G "Ninja" ^
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^
-DECAL_USE_HDF5=ON ^
-DECAL_USE_QT=ON ^
-DECAL_USE_CURL=ON ^
-DECAL_USE_CAPNPROTO=OFF ^
-DECAL_USE_FTXUI=ON ^
-DECAL_BUILD_DOCS=ON ^
-DECAL_BUILD_APPS=ON ^
-DECAL_BUILD_APP_SDK=ON ^
-DECAL_BUILD_SAMPLES=ON ^
-DECAL_BUILD_TIMEPLUGINS=ON ^
-DECAL_BUILD_PY_BINDING=OFF ^
-DECAL_BUILD_CSHARP_BINDING=OFF ^
-DECAL_BUILD_TESTS=ON ^
-DECAL_BUILD_BENCHMARKS=ON ^
-DECAL_INSTALL_SAMPLE_SOURCES=ON ^
-DECAL_USE_NPCAP=ON ^
-DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^
-DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^
-DECAL_THIRDPARTY_BUILD_SPDLOG=ON ^
-DECAL_THIRDPARTY_BUILD_TINYXML2=ON ^
-DECAL_THIRDPARTY_BUILD_FINEFTP=ON ^
-DECAL_THIRDPARTY_BUILD_CURL=ON ^
-DECAL_THIRDPARTY_BUILD_GTEST=ON ^
-DECAL_THIRDPARTY_BUILD_HDF5=ON ^
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON ^
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON ^
-DECAL_THIRDPARTY_BUILD_QWT=ON ^
-DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^
-DCMAKE_BUILD_TYPE=Release ^
-DECAL_CPACK_PACK_WITH_INNOSETUP=ON
shell: cmd
- name: Build SDK
run: cmake --build . --config Debug
working-directory: ${{ runner.workspace }}/_build/sdk
- name: SDK Integration test
run: |
cmake --install "${{ runner.workspace }}/_build/sdk" --prefix "${{ runner.workspace }}/_install/sdk" --config Debug
cmake -G "Ninja" ^
-S serialization/protobuf/samples/pubsub/person_loopback ^
-B _integration_test_build ^
-DCMAKE_CONFIGURATION_TYPES="Debug" ^
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}/_install/sdk"
cmake --build _integration_test_build --config Debug
shell: cmd
- name: Build Release
run: cmake --build . --config Release
working-directory: ${{ runner.workspace }}/_build/complete
- name: Save ccache cache to GitHub
uses: ./.github/actions/ccache-save
with:
key: ${{steps.ccache_cache-restore.outputs.cache-primary-key}}
cache-dir: ${{ github.workspace }}/.ccache
# Always save cache if configure succeeded (even if the build failed)
if: ${{ always() && steps.cmake-configure.outcome == 'success' }}
- name: Create eCAL install tree for for C# bindings
run: |
cmake --install "${{ runner.workspace }}/_build/complete" ^
--prefix "${{ runner.workspace }}/_install/complete"
shell: cmd
- name: Configure C# bindings
run: |
cmake -S lang/csharp -B "${{ runner.workspace }}/_build/csharp" ^
-G "Visual Studio 17 2022" -A x64 -T v142 ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_PREFIX_PATH="${{ runner.workspace }}/_install/complete" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CONFIGURATION_TYPES=Release ^
-DECAL_CSHARP_BUILD_SAMPLES=ON ^
-DECAL_CSHARP_BUILD_TESTS=ON ^
-DECAL_PROJECT_ROOT="${{ github.workspace }}"
shell: cmd
- name: Build C# bindings
run: cmake --build "${{ runner.workspace }}/_build/csharp" --config Release
shell: cmd
- name: Run C# Tests
run: ctest -C Release -V --test-dir "${{ runner.workspace }}/_build/csharp"
- name: Run Tests
run: ctest -C Release -V
working-directory: ${{ runner.workspace }}/_build/complete
- name: Pack SDK
run: cpack -C Debug
working-directory: ${{ runner.workspace }}/_build/sdk
- name: Package C# Bindings
run: cpack -C Release -DCPACK_COMPONENTS_ALL="runtime"
working-directory: ${{ runner.workspace }}/_build/csharp
- name: Pack complete setup
run: cpack -C Release
working-directory: ${{ runner.workspace }}/_build/complete
- name: Get Project version from git tag
shell: powershell
run: |
# Use git describe to get the tag / commit description
$VERSION = git describe --tags --dirty
#remove the leading 'v' from the tag, if it exists
$VERSION = $VERSION -replace '^v', ''
echo "VERSION=$VERSION" >> "$Env:GITHUB_ENV"
- name: Set output binary name
shell: powershell
run: |
$BINARY_NAME = "ecal_${{ env.VERSION }}-win64"
echo "BINARY_NAME=$BINARY_NAME" >> "$Env:GITHUB_ENV"
- name: Rename the setup exe
shell: powershell
run: |
$LS_OUT = ls *.exe
$SETUP_NAME = "$($LS_OUT.Name)"
Rename-Item -Path "$SETUP_NAME" -NewName "${{ env.BINARY_NAME }}.exe"
working-directory: ${{ runner.workspace }}/_build/complete/_deploy/
- name: Upload Windows setup
uses: actions/upload-artifact@v4
with:
name: unsigned-setup
path: ${{ runner.workspace }}/_build/complete/_deploy/*.exe
- name: Upload Benchmark Executables
uses: actions/upload-artifact@v4
with:
name: 'benchmarks'
path: ${{ runner.workspace }}/_build/complete/bin/ecal_benchmark*
- name: Upload eCAL Libraries
uses: actions/upload-artifact@v4
with:
name: 'libraries'
path: ${{ runner.workspace }}/_build/complete/bin/*.dll
# --------------------------------------------------------------------------------------------------
run-benchmarks:
if: github.repository == 'eclipse-ecal/ecal' && github.ref_name == 'master'
runs-on: windows-2022
needs: build-windows
strategy:
fail-fast: false
matrix:
# List of all benchmark types, corresponding to an executable
bm_type: [pubsub, pubsub_config, pubsub_multi, service, setup]
env:
# Name of the benchmark log file without extension
LOG_FILE_NAME: ecal_benchmark_${{ matrix.bm_type }}_log
# Check that this version is also present in the job above and the one used for this job
OS_VERSION: windows-2022
steps:
- name: Fetch Throughput Calculator Python Script
uses: actions/checkout@v4
with:
sparse-checkout: |
ecal/benchmarks/util/throughput_calculator.py
sparse-checkout-cone-mode: false
- name: Download eCAL Libraries
uses: actions/download-artifact@v4
with:
name: 'libraries'
path: ${{ github.workspace }}
- name: Download Benchmark Executables
uses: actions/download-artifact@v4
with:
name: 'benchmarks'
path: ${{ github.workspace }}
- name: Install Bencher CLI
run: |
powershell -c "irm https://bencher.dev/download/install-cli.ps1 | iex"
shell: pwsh
- name: Run Benchmark
run: |
${{ github.workspace }}/ecal_benchmark_${{ matrix.bm_type }}.exe --benchmark_out=${{ env.LOG_FILE_NAME }}.json --benchmark_out_format=json
shell: cmd
- name: Calculate Throughput
if: startsWith(matrix.bm_type, 'pubsub')
run: |
python ecal/benchmarks/util/throughput_calculator.py -f ${{ github.workspace }}/${{ env.LOG_FILE_NAME }}.json
working-directory: ${{ github.workspace }}
shell: cmd
- name: Log Benchmark Results with Bencher
run: |
bencher run `
--project ecal `
--token '${{secrets.BENCHER_API_TOKEN}}' `
--branch '${{ github.ref_name }}' `
--testbed '${{ env.OS_VERSION }}' `
--github-actions '${{ secrets.GITHUB_TOKEN }}' `
--adapter cpp_google `
--file ${{ github.workspace }}/${{ env.LOG_FILE_NAME }}.json
shell: pwsh
- name: Log Calculated Throughput with Bencher
if: startsWith(matrix.bm_type, 'pubsub')
run: |
bencher run `
--project ecal `
--token '${{secrets.BENCHER_API_TOKEN}}' `
--branch '${{ github.ref_name }}' `
--testbed '${{ env.OS_VERSION }}' `
--github-actions '${{ secrets.GITHUB_TOKEN }}' `
--adapter json `
--file ${{ github.workspace }}/${{ env.LOG_FILE_NAME }}_throughput-calculation.json
shell: pwsh
#---------------------------------------------------------------------------------------------------
assess-runner-performance:
runs-on: windows-2022
needs: run-benchmarks
env:
OS_VERSION: windows-2022
steps:
- name: Install Bencher CLI
run: |
powershell -c "irm https://bencher.dev/download/install-cli.ps1 | iex"
shell: pwsh
- name: Fetch 7z-Score Python Script
uses: actions/checkout@v4
with:
sparse-checkout: |
ecal/benchmarks/util/7z_score.py
sparse-checkout-cone-mode: false
- name: Run 7-Zip Benchmark
run: |
python ecal/benchmarks/util/7z_score.py
working-directory: ${{ github.workspace }}
shell: cmd
- name: Log Result with Bencher
run: |
bencher run `
--project ecal `
--token '${{secrets.BENCHER_API_TOKEN}}' `
--branch '${{ github.ref_name }}' `
--testbed '${{ env.OS_VERSION }}' `
--github-actions '${{ secrets.GITHUB_TOKEN }}' `
--adapter json `
--file ${{ github.workspace }}/7z_score.json
shell: pwsh
#---------------------------------------------------------------------------------------------------
sign-windows-installer:
if: github.repository == 'eclipse-ecal/ecal'
runs-on: windows-2022
needs: build-windows
steps:
# Download the installer from the previous job
- name: Download Windows setup
uses: actions/download-artifact@v4
with:
name: unsigned-setup
path: ${{ runner.workspace }}/_build/complete/_deploy
- name: Sign the installer on Eclipse CI
if: env.IS_JENKINS_SIGNING_ALLOWED == 'true' && env.JENKINS_USERNAME != '' && env.JENKINS_API_TOKEN != '' && env.JENKINS_JOB_TOKEN != ''
run: |
$LS_OUT = ls *.exe
$ASSET_NAME = "$($LS_OUT.Name)"
$ASSET_NAME_OLD = "$($ASSET_NAME).old"
$ASSET_NAME_NEW = "$ASSET_NAME"
$JENKINS_JOB = 'gh_auto_file'
$JENKINS_BASE_URL = "https://ci.eclipse.org/ecal"
$JENKINS_CRUMB_URL = "$JENKINS_BASE_URL/crumbIssuer/api/json"
$JENKINS_JOB_URL = "$JENKINS_BASE_URL/job/$JENKINS_JOB"
$JENKINS_TRIGGER_URL = "$JENKINS_JOB_URL/buildWithParameters?token=$Env:JENKINS_JOB_TOKEN"
$WAIT_FOR_JENKINS_SEC = 10
$COUNTER_LIMIT = 30
$RESPONSE_CODE = 0
$CRUMB_ID = ''
$CRUMB_FIELD = ''
$CRUMB_COOKIE = ''
$COUNTER = 0
$QUEUE_URL = ''
$BUILD_NUM = 0
$BUILD_URL = ''
Write-Output "-- get a Jenkins crumb & cookie"
$AUTH_CREDENTIAL = $Env:JENKINS_USERNAME + ':' + $Env:JENKINS_API_TOKEN
$AUTH_ENCODED = [System.Text.Encoding]::UTF8.GetBytes($AUTH_CREDENTIAL)
$AUTH_INFO = [System.Convert]::ToBase64String($AUTH_ENCODED)
$CRUMB_HEADERS = @{
'Authorization'="Basic $($AUTH_INFO)"
}
$RESPONSE = Invoke-WebRequest -Uri $JENKINS_CRUMB_URL -Method GET -Headers $CRUMB_HEADERS
$RES_CODE = $RESPONSE.StatusCode
Write-Output " ++ Jenkins crumb retrieval - HTTP status code: $RES_CODE"
if ($RES_CODE -ge 200 -and $RES_CODE -lt 300) {
$JSON_CONTENT = $RESPONSE.Content | ConvertFrom-Json
$CRUMB_ID = $JSON_CONTENT.crumb
$CRUMB_FIELD = $JSON_CONTENT.crumbRequestField
$CRUMB_COOKIE = $RESPONSE.Headers['Set-Cookie']
#Write-Output " ++ Jenkins crumb: '$CRUMB_ID'"
#Write-Output " ++ Jenkins cookie: '$CRUMB_COOKIE'"
} else {
Write-Output " ** determination of the Jenkins crumb failed"
Exit 1
}
Write-Output "-- trigger a new build of '$JENKINS_JOB' with installer '$ASSET_NAME'"
$TRIGGER_HEADERS = @{
'Authorization'="Basic $($AUTH_INFO)"
'Cookie'=$CRUMB_COOKIE
$CRUMB_FIELD=$CRUMB_ID
}
$FORM = @{
'GH_FILE_NAME'= $ASSET_NAME
'GH_EXECUTABLE'= Get-Item -Path $ASSET_NAME
}
$RESPONSE = Invoke-WebRequest -Uri $JENKINS_TRIGGER_URL -Method POST -Headers $TRIGGER_HEADERS -Form $FORM
$RES_CODE = $RESPONSE.StatusCode
Write-Output " ++ trigger build - HTTP status code: $RES_CODE"
if ($RES_CODE -ge 200 -and $RES_CODE -lt 300) {
$QUEUE_URL = $RESPONSE.Headers.location
$QUEUE_URL = "$($QUEUE_URL)api/json/"
Write-Output " ++ queue URL: $QUEUE_URL"
} else {
Write-Output " ** trigger failure"
Exit 1
}
Write-Output "-- get the new build number"
while ($true) {
$COUNTER++
if ($COUNTER -gt $COUNTER_LIMIT) {
Write-Output " ** determination of the new build number failed after $COUNTER_LIMIT tries"
Exit 1
}
$RESPONSE = Invoke-WebRequest -Uri $QUEUE_URL
$RES_CODE = $RESPONSE.StatusCode
Write-Output " ++ build number retrieval - HTTP status code: $RES_CODE"
if ($RES_CODE -ge 200 -and $RES_CODE -lt 300) {
$JSON_CONTENT = $RESPONSE.Content | ConvertFrom-Json
$EXECUTABLE = $JSON_CONTENT.executable
$BUILD_NUM = $EXECUTABLE.number
if ($BUILD_NUM) {
Write-Output " ++ #build number: $BUILD_NUM"
$BUILD_URL = $EXECUTABLE.url
Break
} else {
Write-Output " ++ ... pending, wait for $WAIT_FOR_JENKINS_SEC s"
Start-Sleep -s $WAIT_FOR_JENKINS_SEC
}
} else {
Write-Output " ** determination of the build number failed, trying again after $WAIT_FOR_JENKINS_SEC s"
Start-Sleep -s $WAIT_FOR_JENKINS_SEC
}
}
$JENKINS_STATUS_URL = "$($BUILD_URL)api/json"
Write-Output "-- check build status of #Build $BUILD_NUM with $JENKINS_STATUS_URL"
while ($true) {
$RESPONSE = Invoke-WebRequest -Uri $JENKINS_STATUS_URL
$RES_CODE = $RESPONSE.StatusCode
Write-Output " ++ status check - HTTP status code: $RES_CODE"
if ($RES_CODE -ge 200 -and $RES_CODE -lt 300) {
$CONTENT = ConvertFrom-Json $RESPONSE.Content
$NUMBER = $CONTENT | Select-Object -expand 'number'
if ($NUMBER -eq $BUILD_NUM) {
$BUILDING = $CONTENT | Select-Object -expand 'building'
if ($BUILDING) {
Write-Output " ++ ... building, wait for $WAIT_FOR_JENKINS_SEC s"
Start-Sleep -s $WAIT_FOR_JENKINS_SEC
} else {
$RESULT = $CONTENT | Select-Object -expand 'result'
if ($RESULT -eq 'SUCCESS') {
Write-Output " ++ build success, asset name: '$ASSET_NAME'"
Break
} else {
Write-Output " ** build failure"
Exit 1
}
}
} else {
Write-Output " ++ ... pending, wait for $WAIT_FOR_JENKINS_SEC s"
Start-Sleep -s $WAIT_FOR_JENKINS_SEC
}
} else {
Write-Output " ** status check failure"
Exit 1
}
}
$JENKINS_DOWNLOAD_URL = "$JENKINS_JOB_URL/$BUILD_NUM/artifact/$ASSET_NAME"
Write-Output "-- download the newly-signed Windows installer from #Build $BUILD_NUM with $JENKINS_DOWNLOAD_URL"
Rename-Item -Path "$ASSET_NAME" -NewName "$ASSET_NAME_OLD"
$RESPONSE = Invoke-WebRequest -Uri $JENKINS_DOWNLOAD_URL -OutFile $ASSET_NAME_NEW -PassThru
$RES_CODE = $RESPONSE.StatusCode
Write-Output " ++ download installer - HTTP status code: $RES_CODE"
if ($RES_CODE -ge 200 -and $RES_CODE -lt 300) {
Write-Output "IS_DOWNLOAD_AVAILABLE=true" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "ASSET_NAME=$ASSET_NAME" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Write-Output " ++ downloaded signed installer: '$ASSET_NAME'"
} else {
Write-Output " ** download failure"
Exit 1
}
env:
JENKINS_USERNAME: ${{ secrets.JENKINS_USERNAME }}
JENKINS_API_TOKEN: ${{ secrets.JENKINS_API_TOKEN }}
JENKINS_JOB_TOKEN: ${{ secrets.JENKINS_TOKEN_GH_FILE }}
working-directory: ${{ runner.workspace }}/_build/complete/_deploy
- name: Determine name of the installer for zip file
if: env.IS_DOWNLOAD_AVAILABLE == 'true'
shell: powershell
run: |
$INSTALLER_NAME = "${{ env.ASSET_NAME }}"
$INSTALLER_NAME_WITHOUT_EXE = $INSTALLER_NAME.Substring(0, $INSTALLER_NAME.Length - 4)
echo "ARTIFACT_NAME=$INSTALLER_NAME_WITHOUT_EXE" >> "$Env:GITHUB_ENV"
- name: Upload Windows setup signed on Eclipse CI
if: env.IS_DOWNLOAD_AVAILABLE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.workspace }}/_build/complete/_deploy/${{ env.ASSET_NAME }}