-
Notifications
You must be signed in to change notification settings - Fork 2
698 lines (601 loc) · 26.8 KB
/
delivery_stable_ci.yaml
File metadata and controls
698 lines (601 loc) · 26.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
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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
name: Delivery stable CI
on:
workflow_dispatch:
inputs:
tag_name:
description: 'The tag name we want to deliver'
required: true
default: 'latest-'
env:
CLOSE_BRANCH: 0
TEAM_RESTRICTIVE_CLOSED_BRANCH: ${{ secrets.TEAM_RESTRICTIVE_CLOSED_BRANCH }}
FROM_EMAIL: ${{ secrets.FROM_EMAIL }}
TO_EMAIL: ${{ secrets.TO_EMAIL }}
MAIL_RELAY: ${{ secrets.MAIL_RELAY }}
QA_TIMEOUT_PER_TEST_LINUX: 150
QA_TIMEOUT_PER_TEST_WIN: 500
LAST_STABLE_TAG_NAME: ${{ github.event.inputs.tag_name }}
jobs:
build_linux:
if: ${{ github.repository_owner == 'OpenRadioss' }}
# DEV ONLY # runs-on: ["${{ matrix.build }}","dev_pmci"]
runs-on: ["${{ matrix.build }}","delivery_stable_ci"]
env:
BUILD_NB_THREAD: 2
STATUS_BUILD: 0
SERVBOT_PAT: ${{ secrets.SERVBOT_PAT }}
strategy:
# If one job fails others are canceled
fail-fast: true
matrix:
include:
### LINUX64 ###
- build: starter_linux64_gf
precision: dp
os: linux64
binary: starter
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
- build: starter_linux64_gf_sp
precision: sp
os: linux64
binary: starter
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
- build: engine_linux64_gf_ompi
precision: dp
os: linux64
binary: engine
mpi: ompi
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
- build: engine_linux64_gf_ompi_sp
precision: sp
os: linux64
binary: engine
mpi: ompi
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
- build: engine_linux64_gf
precision: dp
os: linux64
binary: engine
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
- build: engine_linux64_gf_sp
precision: sp
os: linux64
binary: engine
image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
### LINUXA64 ###
- build: starter_linuxa64
binary: starter
precision: dp
os: linuxa64
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
- build: starter_linuxa64_sp
binary: starter
precision: sp
os: linuxa64
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
- build: engine_linuxa64
binary: engine
precision: dp
os: linuxa64
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
- build: engine_linuxa64_sp
binary: engine
precision: sp
os: linuxa64
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
- build: engine_linuxa64_ompi
binary: engine
precision: dp
os: linuxa64
mpi: ompi
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
- build: engine_linuxa64_ompi_sp
binary: engine
precision: sp
os: linuxa64
mpi: ompi
image_name: linuxa64-rl8.9-bld:armfl24.04-ompi4.1.2-ts11
container:
# Registry variable can't be a secret but can be a simple variable defined at organization level
image: "${{ vars.DOCKER_REGISTRY }}/${{ matrix.image_name }}"
credentials:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
volumes:
- /etc/localtime:/etc/localtime:ro
steps:
# Set the working dir suffixed with branch name
- name: Set workdir
run: |
echo "WORKDIR=lastest" >> $GITHUB_ENV
- name: Create branch oriented WS directory & integration WS
run: |
mkdir -p ${{ env.WORKDIR }}
- name: Clean local exe dir
working-directory: ${{ env.WORKDIR }}
run: |
rm -rf exec
md5sum exec/* || echo "Nothing in exec/"
# Get last git modifications, don't clean before (way to keep persistent obj files)
- name: Checkout git sources
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
clean: 'false'
lfs: 'false'
ref: ${{ env.LAST_STABLE_TAG_NAME }}
- name: Running build
working-directory: ${{ env.WORKDIR }}
run: |
mpi_opts=''
if [ ! -z ${{ matrix.mpi }} ]
then
mpi_opts="-mpi=${{ matrix.mpi }}"
fi
arch_suffix=''
extra_opts=''
if [ "${{ matrix.os }}" = "linux64" ]
then
echo "Running BUILD for linux GF"
arch_suffix='_gf'
extra_opts='-static-link'
source /root/.bashrc
else
echo "Running BUILD for arm"
export MODULEPATH=$MODULEPATH:/opt/arm/modulefiles
source /etc/profile.d/modules.sh
module load binutils/13.2.0 gnu/13.2.0 acfl/24.04
export LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH
fi
cmd="./build_script.sh -release -arch=${{ matrix.os }}$arch_suffix -prec=${{ matrix.precision }} -nt=${{ env.BUILD_NB_THREAD }} $extra_opts $mpi_opts"
echo "========================================="
echo "-- BUILD ${{ matrix.build }} --"
echo "-- $cmd --"
echo "========================================="
chmod 755 Compiling_tools/script/*
chmod 755 ${{ matrix.binary }}/build_script.sh
md5sum exec/* || echo "Nothing in exec/"
mkdir exec
cd ${{ matrix.binary }}
eval $cmd
cd ..
# Exiting with failure is no bins generated, should be handle by build_script soon
md5sum exec/* || exit 1
# Set correct end of step status (if not an email will be sent)
echo "STATUS_BUILD=1" >> $GITHUB_ENV
- name: Managing step execution
if: ${{ always() }}
run: |
MAILMSG="Some error(s) has(ve) been raised during workflow execution:\n\n"
echo -e "\n#### STATUS_STEP_BUILD ${{ matrix.build }} ###"
if [ "$STATUS_BUILD" = 0 ]
then
echo -e "Status\t[ \033[31;2;1mFAILED\033[0m ]"
MAILMSG+="The build ${{ matrix.build }} has failed \n"
# Send email
# Close the branch
echo "CLOSE_BRANCH=1" >> $GITHUB_ENV
# Setting SMTP server (docker host)
DOCKER_HOST=`/sbin/ip route|awk '/default/ { print $3 }'`
echo "set smtp=smtp://${DOCKER_HOST}:25" >> /etc/mail.rc
# Print message in log
echo -e $MAILMSG
# Send email
echo -e "$MAILMSG\nThe branch is closed" | Mail -r $FROM_EMAIL -s "Error in Github CI repo ${{ github.repository }} ($(git rev-list -n 1 ${{ env.LAST_STABLE_TAG_NAME }}))" $TO_EMAIL
# Exit fail to see it as a failure
exit 1
else
echo -e "Status\t[ \033[32;2;1mOK\033[0m ]"
fi
# Upload artifact (since V4 we can't upload artifact using the same name, each one must be unique)
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: bins-${{ matrix.os }}-${{ matrix.precision }}-${{ matrix.build }}
path: ${{ env.WORKDIR }}/exec
if: ${{ env.CLOSE_BRANCH == 0 }}
# We upload extlib only once, arbitrary choice
- name: Upload extlib artifacts
uses: actions/upload-artifact@v4
with:
name: extlib.zip
path: ${{ env.WORKDIR }}/extlib.zip
if: ${{ matrix.build == 'starter_linux64_gf' && env.CLOSE_BRANCH == 0 }}
# Close the branch (= restrict push to team devopsadmins) if needed
# Owner is not mandatory here ... PAT is sufficient ??? seems that as servbot has permissions on this repo so his PAT is sufficient ...
- uses: octokit/request-action@v2.x
id: close_branch_build
env:
GITHUB_TOKEN: ${{ env.SERVBOT_PAT }}
REQUEST_BODY: "['${{ env.TEAM_RESTRICTIVE_CLOSED_BRANCH}}']"
with:
route: PUT /repos/${{ github.repository }}/branches/main/protection/restrictions/teams
data: ${{ env.REQUEST_BODY }}
if: ${{ always() && env.CLOSE_BRANCH == 1 }}
# It the closing went wrong we send an email
- name: "Check result of closing branch and warn if it fails"
run: |
# No need to configure SMTP server, already done in previous steps
MAILMSG="Some error(s) has(ve) been raised during workflow execution:\n\n"
MAILMSG+="A branch closing is needed but has failed\n\n"
MAILMSG+="Return status API is : ${{ steps.close_branch_build.outputs.status }}\n\n"
MAILMSG+="Check more detailed datas in CI logs\n"
# Print message in log
echo -e $MAILMSG
echo -e "\nClose return data API is : ${{ steps.close_branch_build.outputs.data }}"
# Send email
echo -e "$MAILMSG" | Mail -r $FROM_EMAIL -s "Error in Github CI repo ${{ github.repository }} ($(git rev-list -n 1 ${{ env.LAST_STABLE_TAG_NAME }})) on closing branch" $TO_EMAIL
# Exit fail to see it as a failure
exit 1
if: ${{ always() && env.CLOSE_BRANCH == 1 && steps.close_branch_build.outputs.status != 200 }}
build_windows_no_container:
if: ${{ github.repository_owner == 'OpenRadioss' }}
# DEV ONLY # runs-on: ["${{ matrix.build }}","dev_pmci"]
runs-on: ["${{ matrix.build }}","prmerge_ci"]
env:
BUILD_NB_THREAD: 2
STATUS_BUILD: 0
SERVBOT_PAT: ${{ secrets.SERVBOT_PAT }}
CLOSE_BRANCH: 0
strategy:
# If one job fails others are canceled
fail-fast: true
matrix:
include:
- build: starter_win64
precision: dp
os: win64
binary: starter
- build: starter_win64_sp
precision: sp
os: win64
binary: starter
- build: engine_win64_impi
precision: dp
os: win64
binary: engine
mpi: impi
- build: engine_win64_impi_sp
precision: sp
os: win64
binary: engine
mpi: impi
- build: engine_win64
precision: dp
os: win64
binary: engine
- build: engine_win64_sp
precision: sp
os: win64
binary: engine
steps:
# Set the working dir suffixed with branch name
- name: Set workdir
run: |
Add-Content -Path $env:GITHUB_ENV -Value "WORKDIR=lastest"
- name: Create branch oriented WS directory & integration WS (WIN64)
run: |
$dir2create = "$env:WORKDIR"
if (-not (Test-Path -Path $dir2create)) {
New-Item -Path $dir2create -ItemType "Directory"
}
- name: Clean local exe dir
working-directory: ${{ env.WORKDIR }}
run: |
$dir2remove = "exec"
if (Test-Path -Path $dir2remove) {
Remove-Item -Path $dir2remove -Recurse -Force
}
# Get last git modifications, don't clean before (way to keep persistent obj files)
- name: Checkout git sources
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
clean: 'false'
lfs: 'false'
ref: ${{ env.LAST_STABLE_TAG_NAME }}
- name: Running builds
working-directory: ${{ env.WORKDIR }}
run: |
cd ${{ matrix.binary }}
@"
@echo off
call 'C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\env\vars.bat'
call 'C:\Program Files (x86)\Intel\oneAPI\mkl\2025.0\env\vars.bat'
call 'C:\Program Files (x86)\Intel\oneAPI\mpi\2021.10.0\env\vars.bat'
cmake --version
ninja --version
if not '${{ matrix.mpi }}'=='' (
set mpi_opts=-mpi=${{ matrix.mpi }}
)
echo =========================================
echo -- BUILD ${{ matrix.build }} --
echo =========================================
.\build_windows.bat -release -arch=${{ matrix.os }} -prec=${{ matrix.precision }} -nt=$env:BUILD_NB_THREAD %mpi_opts%
"@ -replace "'", '"' | Out-File -FilePath myrun.bat -Encoding ASCII
cmd /c .\myrun.bat
cd ..
$directoryPath = "exec"
if (Test-Path -Path $directoryPath) {
$files = Get-ChildItem -Path $directoryPath
if ($files.Count -eq 0) {
Write-Output "The directory is empty."
exit 1
} else {
# Display the contents of the directory
$files | ForEach-Object { Write-Output $_.FullName }
}
} else {
Write-Output "The directory does not exist."
exit 1
}
Add-Content -Path $env:GITHUB_ENV -Value "STATUS_BUILD=1"
- name: Managing step execution
if: ${{ always() }}
run: |
$MAILMSG = "Some error(s) has(ve) been raised during workflow execution:`r`n`r`n"
Write-Output "`r`n#### STATUS_STEP_BUILD ${{ matrix.build }} ($env:STATUS_BUILD) ###"
if ($env:STATUS_BUILD -eq 0) {
Write-Output "Status`t[ $([char]27)[31;2;1mFAILED$([char]27)[0m ]"
$MAILMSG += "The build ${{ matrix.build }} has failed `r`n"
Add-Content -Path $env:GITHUB_ENV -Value "CLOSE_BRANCH=1"
$ALL_RECIPIENTS = $env:TO_EMAIL -split ","
Send-MailMessage -SmtpServer $env:MAIL_RELAY -From $env:FROM_EMAIL -To $ALL_RECIPIENTS -Subject "Error in Github CI repo ${{ github.repository }} ($(git rev-list -n 1 ${{ env.LAST_STABLE_TAG_NAME }}))" -Body $MAILMSG -Port 25
exit 1
}
else {
Write-Output "Status`t[ $([char]27)[32;2;1mOK$([char]27)[0m ]"
}
# Upload artifact (since V4 we can't upload artifact using the same name, each one must be unique)
- name: Upload built artifacts
uses: actions/upload-artifact@v4
with:
name: bins-${{ matrix.os }}-${{ matrix.precision }}-${{ matrix.build }}
path: ${{ env.WORKDIR }}/exec
if: ${{ env.CLOSE_BRANCH == 0 }}
# Close the branch (= restrict push to team devopsadmins) if needed
# Owner is not mandatory here ... PAT is sufficient ??? seems that as servbot has permissions on this repo so his PAT is sufficient ...
- name: Close the branch if errors
uses: octokit/request-action@v2.x
id: close_branch_build
env:
GITHUB_TOKEN: ${{ env.SERVBOT_PAT }}
REQUEST_BODY: "['${{ env.TEAM_RESTRICTIVE_CLOSED_BRANCH}}']"
with:
route: PUT /repos/${{ github.repository }}/branches/main/protection/restrictions/teams
data: ${{ env.REQUEST_BODY }}
if: ${{ always() && env.CLOSE_BRANCH == 1 }}
# If the closing went wrong we send an email
- name: "Check result of closing branch and warn if it fails"
run: |
$MAILMSG = "Some error(s) has(ve) been raised during workflow execution:`r`n`r`n"
$MAILMSG += "A branch closing is needed but has failed`r`n`r`n"
$MAILMSG += "Return status API is : ${{ steps.close_branch_build.outputs.status }}`r`n`r`n"
$MAILMSG += "Check more detailed datas in CI logs`r`n"
Write-Output "`r`nClose return API is : ${{ steps.close_branch_build.outputs.status }} / ${{ steps.close_branch_build.outputs.data }}";
$ALL_RECIPIENTS = $env:TO_EMAIL -split ","
Send-MailMessage -SmtpServer $env:MAIL_RELAY -From $env:FROM_EMAIL -To $ALL_RECIPIENTS -Subject "Error in Github CI repo ${{ github.repository }} ($(git rev-list -n 1 ${{ env.LAST_STABLE_TAG_NAME }})) on closing branch" -Body $MAILMSG -Port 25
exit 1
if: ${{ always() && env.CLOSE_BRANCH == 1 && steps.close_branch_build.outputs.status != 200 }}
delivery:
needs: [build_linux,build_windows_no_container]
# DEV ONLY # runs-on: dev_delivery
runs-on: delivery
container:
# Registry variable can't be a secret but can be a simple variable defined at organization level
image: "${{ vars.DOCKER_REGISTRY }}/rd-linux64-common:latest"
credentials:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
volumes:
- /etc/localtime:/etc/localtime:ro
# DEV ONLY # - /github_download_counter_dev:/github_download_counter
- /github_download_counter:/github_download_counter
env:
SERVBOT_USER: ${{ secrets.SERVBOT_USER }}
SERVBOT_PAT: ${{ secrets.SERVBOT_PAT }}
DELIVERY_NB_RELEASES_TO_KEEP: 3
DELIVERY_TAG_PREFIX: 'latest-'
OPENRADIOSS_MAINDIR_NAME: 'OpenRadioss'
OPENRADIOSS_GUI: 'openradioss_gui'
TOOLS_OPENRADIOSS_GUI: 'TOOLS/openradioss_gui'
TOOLS_INP2RAD: 'TOOLS/input_converters/inp2rad/inp2rad/inp2rad.py'
CI: 'true' # if true, disables interactive prompts and progress bar
JFROG_CLI_AVOID_NEW_VERSION_WARNING: "true"
JFROG_CLI_LOG_LEVEL: "ERROR"
JF_OPTIONS: "--url=${{ secrets.JFROG_DELIVERY_URL }} --user=${{ secrets.JFROG_DELIVERY_USER }} --password=${{ secrets.JFROG_DELIVERY_TOKEN }}"
JF_TOOLS_OUTPUT_CONVERTERS: "${{ secrets.JFROG_DELIVERY_RADIOSS_REPO }}/OpenRadioss_Tools/output_converters"
steps:
# Set the working dir suffixed with deliv_stable
- name: Set workdir
run: |
echo "WORKDIR=deliv_stable" >> $GITHUB_ENV
- name: Create branch oriented WS directory & integration WS
run: |
mkdir -p ${{ env.WORKDIR }}
- name: Set the release name & clean previous exec
working-directory: ${{ env.WORKDIR }}
run: |
echo "DATEOFTHETAG=${LAST_STABLE_TAG_NAME#latest-}" >> $GITHUB_ENV
rm -rf exec todeliver exec_tmp
# Get last git modifications, don't clean before (way to go faster)
- name: Checkout git sources
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
lfs: 'false'
ref: ${{ env.LAST_STABLE_TAG_NAME }}
# Get OpenRadioss extras from dedicated repository
- name: Checkout git EXTRA sources
uses: actions/checkout@v4
with:
lfs: 'true'
clean: 'false'
repository: '${{ secrets.EXTRA_REPOSITORY }}'
path: "${{ env.WORKDIR }}/EXTRA"
token: '${{ secrets.EXTRA_REPOSITORY_PAT }}'
# Get OpenRadioss gui in Tools repository
- name: Checkout git Tools sources
uses: actions/checkout@v4
with:
lfs: 'true'
clean: 'false'
repository: '${{ secrets.TOOLS_REPOSITORY }}'
path: "${{ env.WORKDIR }}/TOOLS"
token: '${{ secrets.EXTRA_REPOSITORY_PAT }}'
# Download ALL artifacts (including extlib.zip)
- name: Download ALL artifacts for packaging
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: "${{ env.WORKDIR }}/exec_tmp"
- name: Check files in exec
working-directory: ${{ env.WORKDIR }}
run: |
ls -l exec_tmp/
- name: Copy all artifact complex structure into flat files in exec
working-directory: ${{ env.WORKDIR }}
run: |
echo "List exec_tmp : "
find exec_tmp -type f
mv exec_tmp/extlib.zip ./
for os in linux64 linuxa64 win64
do
mkdir -p exec/${os}
cp -p exec_tmp/*${os}* exec/${os}/
chmod 755 exec/${os}/*
done
echo "List exec : "
find exec -type f
- name: Unzip extlib
working-directory: ${{ env.WORKDIR }}
run: |
unzip extlib.zip
- name: Provide ALL binaries
working-directory: ${{ env.WORKDIR }}
run: |
# Removed lfs hook (not supported in next action, not neeeded)
rm -f .git/hooks/pre-push
# Prepare tree architecture
rm -rf todeliver
for os in linux64 linuxa64 win64
do
mkdir -p todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/extlib/h3d/lib/${os} todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/extlib/hm_reader todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/exec
cp -a extlib/h3d/lib/${os}/* todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/extlib/h3d/lib/${os}/
cp -a extlib/hm_reader/${os} todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/extlib/hm_reader/
# Get Intel runtime and some other extras from a dedicated repository
if test -d EXTRA/${os}
then
cp -a EXTRA/${os}/* todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/
fi
# Get OpenRadioss gui from Tools repository and inp2rad
if test -d ${{ env.TOOLS_OPENRADIOSS_GUI}}
then
cp -a ${{ env.TOOLS_OPENRADIOSS_GUI}} todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/
if test -f ${{ env.TOOLS_INP2RAD}}
then
cp -a ${{ env.TOOLS_INP2RAD}} todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/${{ env.OPENRADIOSS_GUI }}/
fi
fi
# Get some output converters from Tools repository
jf rt download ${JF_OPTIONS} "${JF_TOOLS_OUTPUT_CONVERTERS}/${os}/*" todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/exec/ --flat=true
chmod 755 todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/exec/*
cp -a hm_cfg_files todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/
cp -a exec/${os}/* todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/exec/
mkdir -p todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/licenses
cp -a extlib/license/* todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/licenses/
cp -a COPYRIGHT.md todeliver/${os}/${{ env.OPENRADIOSS_MAINDIR_NAME }}/
export OPENRADIOSS_BIN_ARCHIVE="${{ env.OPENRADIOSS_MAINDIR_NAME }}_${os}.zip"
cd todeliver/${os}
zip -r ../$OPENRADIOSS_BIN_ARCHIVE ${{ env.OPENRADIOSS_MAINDIR_NAME }}
cd ..
rm -rf ${os}
cd ..
done
- name: Set some variables
working-directory: ${{ env.WORKDIR }}
run: |
echo "LAST_STABLE_COMMIT=$(git rev-list -n 1 ${{ env.LAST_STABLE_TAG_NAME }})" >> $GITHUB_ENV
# Way to deal with special chars in a commit message
{
echo "LAST_STABLE_COMMIT_MESSAGE<<EOF"
git log -1 --format=%B "${{ env.LAST_STABLE_TAG_NAME }}"
echo "EOF"
} >> $GITHUB_ENV
- uses: octokit/request-action@v2.x
id: get_commit_author
env:
GITHUB_TOKEN: ${{ env.SERVBOT_PAT }}
REQUEST_BODY: "['${{ env.LAST_STABLE_COMMIT }}']"
with:
route: GET /repos/${{ github.repository }}/commits/${{ env.LAST_STABLE_COMMIT }}
- name: Counter Download - Update values
working-directory: ${{ env.WORKDIR }}
run: |
cd /github_download_counter
# Do some before using some lock and retry stuff
cp download_count.json sav-delivery-${{ env.DATEOFTHETAG }}-download_count.json
github_download_count.py \
--git_api_url ${{ github.api_url }} \
--git_repo ${{ github.repository }} \
--git_user $SERVBOT_USER \
--git_token $SERVBOT_PAT \
--action update_values
# The action creates the release with an already existing tag (latest-xxxxx) so we use option skip_tag_creation: true
# We do this because we have already checkouted the wanted commit before
# Prerequisite: create the tag with command : git tag latest-YYYMMDD <commit id>; git push origin latest-YYYMMDD
- name: Release the new binaries
uses: docker://ghcr.io/mini-bomba/create-github-release:v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
release: "${{ env.LAST_STABLE_TAG_NAME }}"
tag: "${{ env.LAST_STABLE_TAG_NAME }}"
name: "Last stable build on ${{ env.DATEOFTHETAG }}"
body: |
This automatic release is built from commit ${{ env.LAST_STABLE_COMMIT }} and authored by @${{ fromJson(steps.get_commit_author.outputs.data).author.login }}
[Github Actions workflow run that built this release](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Commit message:
${{ env.LAST_STABLE_COMMIT_MESSAGE }}
Thank you for downloading OpenRadioss! We'd love to hear about your experience.
👉 [Share your feedback here](https://app.sli.do/event/uxEN5N2jZqeUHnqZEyqrcx)
files: |
${{ env.WORKDIR }}/todeliver/*
clear_attachments: true
skip_tag_creation: true
target_commit: ${{ env.LAST_STABLE_COMMIT }}
- name: Counter Download - Update/Add entries
working-directory: ${{ env.WORKDIR }}
run: |
cd /github_download_counter
github_download_count.py \
--git_api_url ${{ github.api_url }} \
--git_repo ${{ github.repository }} \
--git_user $SERVBOT_USER \
--git_token $SERVBOT_PAT \
--action update \
--tag_date ${{ env.DATEOFTHETAG }}
- name: Clean old github release/tag if needed + clean Counter Download
working-directory: ${{ env.WORKDIR }}
run: |
clean_github_release.py \
--git_api_url ${{ github.api_url }} \
--git_repo ${{ github.repository }} \
--git_user $SERVBOT_USER \
--git_token $SERVBOT_PAT \
--nb_releases_to_keep ${{ env.DELIVERY_NB_RELEASES_TO_KEEP }} \
--counter_file_dir /github_download_counter \
--tag_prefix ${{ env.DELIVERY_TAG_PREFIX }}
- name: Create a new GitHub Discussion Annoucement
id: create-discussion
uses: abirismyname/create-discussion@v2.1.0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: OpenRadioss Stable Update (${{ env.LAST_STABLE_TAG_NAME }})
body: |
We're excited to announce a new **stable release of OpenRadioss!**
This version, based on **tag ${{ env.LAST_STABLE_TAG_NAME }}**, brings improved stability and performance based on community feedback.
🔹 [Get it now](https://github.com/${{ github.repository }}/releases/tag/${{ env.DELIVERY_TAG_PREFIX }}${{ env.DATEOFTHETAG }})
Please, try it out and share your appreciated feedback, thanks!
repository-id: ${{ secrets.DISCUSSION_REPO_ID }}
category-id: ${{ secrets.DISCUSSION_CAT_ID }}