-
-
Notifications
You must be signed in to change notification settings - Fork 12
603 lines (502 loc) · 29.9 KB
/
cd_standard.yaml
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
name: Continuous Delivery
on:
workflow_dispatch:
branches: [ develop, main ]
inputs:
publish:
type: boolean
required: true
description: Publish the NuGet packages to nuget.org
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
OpenDdsVersion: "3.25"
jobs:
build_windows_native:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
BuildPlatform: [x64, x86]
BuildConfiguration: [Release]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Cache OpenDDS libraries
id: opendds-libraries-windows-cd
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/README.md
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/cmake/**/*
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/tools/rapidjson/**/*
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.pl
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.dll
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.lib
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.exe
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/dds/idl/IDLTemplate.txt
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.h
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.hpp
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.cpp
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.inl
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.idl
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/**/*.pidl
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/VERSION.txt
key: opendds-cache-${{ env.OpenDdsVersion }}-${{ matrix.BuildConfiguration }}-win-${{ matrix.BuildPlatform }}-cd
- name: Build Native (No cached)
shell: pwsh
if: steps.opendds-libraries-windows-cd.outputs.cache-hit != 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --BuildConfiguration=${{ matrix.BuildConfiguration }} --BuildPlatform=${{ matrix.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=False --IgnoreThirdPartyBuild=False --VisualStudioVersion=VS2022
working-directory: ${{ github.workspace }}/Build
- name: Build Native (Cached)
shell: pwsh
if: steps.opendds-libraries-windows-cd.outputs.cache-hit == 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --exclusive --BuildConfiguration=${{ matrix.BuildConfiguration }} --BuildPlatform=${{ matrix.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=True --IgnoreThirdPartyBuild=True --VisualStudioVersion=VS2022
working-directory: ${{ github.workspace }}/Build
- name: Stage Native
shell: pwsh
run: |
$targetDir = ".\opendds-native-win-${{ matrix.BuildPlatform }}"
New-Item -Path "." -Name "opendds-native-win-${{ matrix.BuildPlatform }}" -ItemType "directory"
XCOPY ".\README.md" "$targetDir\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\dds\idl\IDLTemplate.txt" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\dds\idl\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\VERSION.txt" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\Native\build_${{ matrix.BuildPlatform }}\OpenDDSWrapper\Release\OpenDDSWrapper.dll" "$targetDir\Native\build_${{ matrix.BuildPlatform }}\OpenDDSWrapper\Release\" /D /S /Y /M
XCOPY ".\Native\build_${{ matrix.BuildPlatform }}\OpenDDSharp.IdlGenerator\Release\openddsharp_idl.exe" "$targetDir\Native\build_${{ matrix.BuildPlatform }}\OpenDDSharp.IdlGenerator\Release\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\cmake\*" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\cmake\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\tools\rapidjson\*" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\tools\rapidjson\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.cmake" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.pl" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.dll" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.lib" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.exe" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.h" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.hpp" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.cpp" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.inl" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.idl" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\*.pidl" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\" /D /S /Y /M
$compress = @{
Path = $targetDir
CompressionLevel = "Fastest"
DestinationPath = ".\opendds-native-win-${{ matrix.BuildPlatform }}.zip"
}
Compress-Archive @compress
- name: Artifacts OpenDDS libraries
uses: actions/upload-artifact@v3
with:
name: opendds-win-${{ matrix.BuildPlatform }}-${{ github.run_number }}
path: ${{ github.workspace }}/opendds-native-win-${{ matrix.BuildPlatform }}.zip
build_linux_native:
runs-on: ubuntu-latest
env:
BuildPlatform: "x64"
BuildConfiguration: "Release"
LD_RPATH_FLAGS: "-Wl,-E '-Wl,-rpath,$$ORIGIN'"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Cache OpenDDS libraries
id: opendds-libraries-linux-cd
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/README.md
${{ github.workspace }}/ext/OpenDDS_Linux/cmake/**/*
${{ github.workspace }}/ext/OpenDDS_Linux/tools/rapidjson/**/*
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.pl
${{ github.workspace }}/ext/OpenDDS_Linux/**/lib*.so*
${{ github.workspace }}/ext/OpenDDS_Linux/bin/
${{ github.workspace }}/ext/OpenDDS_Linux/ACE_wrappers/bin/
${{ github.workspace }}/ext/OpenDDS_Linux/dds/idl/IDLTemplate.txt
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.h
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.hpp
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.cpp
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.inl
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.idl
${{ github.workspace }}/ext/OpenDDS_Linux/**/*.pidl
${{ github.workspace }}/ext/OpenDDS_Linux/VERSION.txt
${{ github.workspace }}/ext/OpenDDS_Linux/tools/
${{ github.workspace }}/ext/OpenDDS_Linux/dds/InfoRepo/DCPSInfoRepo
${{ github.workspace }}/ext/OpenDDS_Linux/dds/idl/opendds_idl
${{ github.workspace }}/ext/OpenDDS_Linux/ACE_wrappers/apps/gperf/src/ace_gperf
${{ github.workspace }}/ext/OpenDDS_Linux/ACE_wrappers/TAO/TAO_IDL/tao_idl
key: opendds-cache-${{ env.OpenDdsVersion }}-linux-${{ env.BuildPlatform }}-cd
- name: Build Native (No cached)
shell: pwsh
if: steps.opendds-libraries-linux-cd.outputs.cache-hit != 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --BuildConfiguration=${{ env.BuildConfiguration }} --BuildPlatform=${{ env.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=False --IgnoreThirdPartyBuild=False
working-directory: ${{ github.workspace }}/Build
- name: Build Native (Cached)
shell: pwsh
if: steps.opendds-libraries-linux-cd.outputs.cache-hit == 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --exclusive --BuildConfiguration=${{ env.BuildConfiguration }} --BuildPlatform=${{ env.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=True --IgnoreThirdPartyBuild=True
working-directory: ${{ github.workspace }}/Build
- name: Stage Native
shell: pwsh
run: |
$sourceDir = "./ext/OpenDDS_Linux"
$targetDir = "./opendds-native-linux-x64"
mkdir "$targetDir"
rsync -r -m -v --include='*.pl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.h' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.hpp' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.cpp' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.inl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.pidl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='bin/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='tools/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='cmake/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='*lib*.so*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='dds/idl/IDLTemplate.txt' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='dds/InfoRepo/DCPSInfoRepo' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='tools/dcpsinfo_dump/dcpsinfo_dump'--include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='dds/idl/opendds_idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='tools/repoctl/repoctl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='ACE_wrappers/apps/gperf/src/ace_gperf' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='ACE_wrappers/TAO/TAO_IDL/tao_idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='README.md' --include='*/' --exclude='*' ./ $targetDir
rsync -r -m -v --include='Native/build_Linux/OpenDDSWrapper/libOpenDDSWrapper.so' --include='*/' --exclude='*' ./ $targetDir
rsync -r -m -v --include='Native/build_Linux/OpenDDSharp.IdlGenerator/openddsharp_idl' --include='*/' --exclude='*' ./ $targetDir
ls -la ./opendds-native-linux-x64
ls -la ./opendds-native-linux-x64/OpenDDS_Linux
ls -la ./opendds-native-linux-x64/Native
zip -r "opendds-native-linux-x64.zip" "./opendds-native-linux-x64"
- name: Artifact OpenDDS libraries
uses: actions/upload-artifact@v3
with:
name: opendds-linux-x64-${{ github.run_number }}
path: ${{ github.workspace }}/opendds-native-linux-x64.zip
build_macos_native:
runs-on: macos-latest
env:
BuildPlatform: "x64"
BuildConfiguration: "Release"
LD_RPATH_FLAGS: "-Wl,-rpath,@executable_path -Wl,-rpath,@loader_path"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Cache OpenDDS libraries
id: opendds-libraries-macos-cd
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/README.md
${{ github.workspace }}/ext/OpenDDS_MacOS/cmake/**/*
${{ github.workspace }}/ext/OpenDDS_MacOS/tools/rapidjson/**/*
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.pl
${{ github.workspace }}/ext/OpenDDS_MacOS/**/lib*.dylib
${{ github.workspace }}/ext/OpenDDS_MacOS/bin/
${{ github.workspace }}/ext/OpenDDS_MacOS/ACE_wrappers/bin/
${{ github.workspace }}/ext/OpenDDS_MacOS/dds/idl/IDLTemplate.txt
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.h
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.hpp
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.cpp
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.inl
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.idl
${{ github.workspace }}/ext/OpenDDS_MacOS/**/*.pidl
${{ github.workspace }}/ext/OpenDDS_MacOS/VERSION.txt
${{ github.workspace }}/ext/OpenDDS_MacOS/tools/
${{ github.workspace }}/ext/OpenDDS_MacOS/dds/InfoRepo/DCPSInfoRepo
${{ github.workspace }}/ext/OpenDDS_MacOS/dds/idl/opendds_idl
${{ github.workspace }}/ext/OpenDDS_MacOS/ACE_wrappers/apps/gperf/src/ace_gperf
${{ github.workspace }}/ext/OpenDDS_MacOS/ACE_wrappers/TAO/TAO_IDL/tao_idl
key: opendds-cache-${{ env.OpenDdsVersion }}-osx-${{ env.BuildPlatform }}-cd
- name: Build Native (No cached)
shell: pwsh
if: steps.opendds-libraries-macos-cd.outputs.cache-hit != 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --BuildConfiguration=${{ env.BuildConfiguration }} --BuildPlatform=${{ env.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=False --IgnoreThirdPartyBuild=False
working-directory: ${{ github.workspace }}/Build
- name: Build Native (Cached)
shell: pwsh
if: steps.opendds-libraries-macos-cd.outputs.cache-hit == 'true'
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=BuildOpenDDSharpNativeTask --exclusive --BuildConfiguration=${{ env.BuildConfiguration }} --BuildPlatform=${{ env.BuildPlatform }} --OpenDdsVersion=${{ env.OpenDdsVersion }} --IgnoreThirdPartySetup=True --IgnoreThirdPartyBuild=True
working-directory: ${{ github.workspace }}/Build
- name: Stage Native
shell: pwsh
run: |
$sourceDir = "./ext/OpenDDS_MacOS"
$targetDir = "./opendds-native-osx-x64"
mkdir "$targetDir"
rsync -r -m -v --include='*.pl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.h' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.hpp' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.cpp' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.inl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='*.pidl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='bin/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='tools/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='cmake/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='cmake/*' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -LKH --include='*lib*.dylib' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='dds/idl/IDLTemplate.txt' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='dds/InfoRepo/DCPSInfoRepo' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='tools/dcpsinfo_dump/dcpsinfo_dump'--include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='dds/idl/opendds_idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='tools/repoctl/repoctl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='ACE_wrappers/apps/gperf/src/ace_gperf' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v -L --include='ACE_wrappers/TAO/TAO_IDL/tao_idl' --include='*/' --exclude='*' $sourceDir $targetDir
rsync -r -m -v --include='README.md' --include='*/' --exclude='*' ./ $targetDir
rsync -r -m -v --include='Native/build_MacOS/OpenDDSWrapper/libOpenDDSWrapper.dylib' --include='*/' --exclude='*' ./ $targetDir
rsync -r -m -v --include='Native/build_MacOS/OpenDDSharp.IdlGenerator/openddsharp_idl' --include='*/' --exclude='*' ./ $targetDir
ls -la ./opendds-native-osx-x64
ls -la ./opendds-native-osx-x64/OpenDDS_MacOS
ls -la ./opendds-native-osx-x64/Native
zip -r "opendds-native-osx-x64.zip" "./opendds-native-osx-x64"
- name: Artifacts OpenDDS libraries
uses: actions/upload-artifact@v3
with:
name: opendds-osx-x64-${{ github.run_number }}
path: ${{ github.workspace }}/opendds-native-osx-x64.zip
build_artifacts:
runs-on: windows-latest
needs: [build_windows_native, build_linux_native, build_macos_native]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet 6.0
shell: pwsh
run: |
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1';
./dotnet-install.ps1 -Architecture 'x64' -Channel 6.0;
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup dotnet 7.0
shell: pwsh
run: |
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1';
./dotnet-install.ps1 -Architecture 'x64' -Channel 7.0;
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.12.0'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v7
- name: Download OpenDDS Native win-x86
uses: actions/download-artifact@v3
with:
name: opendds-win-x86-${{ github.run_number }}
- name: Download OpenDDS Native win-x64
uses: actions/download-artifact@v3
with:
name: opendds-win-x64-${{ github.run_number }}
- name: Download OpenDDS Native linux-x64
uses: actions/download-artifact@v3
with:
name: opendds-linux-x64-${{ github.run_number }}
- name: Download OpenDDS Native osx-x64
uses: actions/download-artifact@v3
with:
name: opendds-osx-x64-${{ github.run_number }}
- name: Prepare OpenDDS Native
shell: pwsh
run: |
Expand-Archive -Path "${{ github.workspace }}\opendds-native-win-x64.zip" -DestinationPath "."
Expand-Archive -Path "${{ github.workspace }}\opendds-native-win-x86.zip" -DestinationPath "."
Expand-Archive -Path "${{ github.workspace }}\opendds-native-linux-x64.zip" -DestinationPath "."
Expand-Archive -Path "${{ github.workspace }}\opendds-native-osx-x64.zip" -DestinationPath "."
XCOPY ".\opendds-native-win-x64\OpenDDS_x64\*" "${{ github.workspace }}\ext\OpenDDS_x64\" /D /S /Y /M
XCOPY ".\opendds-native-win-x64\Native\*" "${{ github.workspace }}\Native\" /D /S /Y /M
XCOPY ".\opendds-native-win-x86\OpenDDS_x86\*" "${{ github.workspace }}\ext\OpenDDS_x86\" /D /S /Y /M
XCOPY ".\opendds-native-win-x86\Native\*" "${{ github.workspace }}\Native\" /D /S /Y /M
XCOPY ".\opendds-native-linux-x64\OpenDDS_Linux\*" "${{ github.workspace }}\ext\OpenDDS_Linux\" /D /S /Y /M
XCOPY ".\opendds-native-linux-x64\Native\*" "${{ github.workspace }}\Native\" /D /S /Y /M
XCOPY ".\opendds-native-osx-x64\OpenDDS_MacOS\*" "${{ github.workspace }}\ext\OpenDDS_MacOS\" /D /S /Y /M
XCOPY ".\opendds-native-osx-x64\Native\*" "${{ github.workspace }}\Native\" /D /S /Y /M
- name: Set release version
shell: pwsh
run: ${{ github.workspace }}\Build\OpenDDSharp.Build.ps1 --target=SetVersion --MajorVersion=${{ env.GitVersion_Major }} --MinorVersion=${{ env.GitVersion_Minor }} --PatchVersion=${{ env.GitVersion_Patch }} --BuildNumber=${{ env.GitVersion_WeightedPreReleaseNumber }} --PreReleaseTag="${{ env.GitVersion_PreReleaseLabel }}" --BranchName="${{ steps.branch-name.outputs.current_branch }}"
working-directory: ${{ github.workspace }}\Build
- name: Dotnet restore
shell: cmd
run: |
dotnet restore ${{ github.workspace }}/OpenDDSharp.sln --no-cache --configfile ${{ github.workspace }}/nuget.config
dotnet restore ${{ github.workspace }}/Examples/ConsoleDemoCore/ConsoleDemoCore.csproj --no-cache --configfile ${{ github.workspace }}/nuget.config
dotnet restore ${{ github.workspace }}/Tests/TestSupportProcessCore/TestSupportProcessCore.csproj --no-cache --configfile ${{ github.workspace }}/nuget.config
dotnet restore ${{ github.workspace }}/Tests/OpenDDSharp.UnitTest/OpenDDSharp.UnitTest.csproj --no-cache --configfile ${{ github.workspace }}/nuget.config
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp.BuildTasks project
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp.BuildTasks/OpenDDSharp.BuildTasks.csproj -property:Configuration=Release
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp x86
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp/OpenDDSharp.csproj -property:Configuration=Release -property:Platform=x86
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp x64
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp/OpenDDSharp.csproj -property:Configuration=Release -property:Platform=x64
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp AnyCPU
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp/OpenDDSharp.csproj -property:Configuration=Release -property:Platform=AnyCPU
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp.Marshaller x86
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp.Marshaller/OpenDDSharp.Marshaller.csproj -property:Configuration=Release -property:Platform=x86
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp.Marshaller x64
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp.Marshaller/OpenDDSharp.Marshaller.csproj -property:Configuration=Release -property:Platform=x64
working-directory: ${{ github.workspace }}
- name: Build OpenDDSharp.Marshaller AnyCPU
shell: cmd
run: dotnet msbuild -target:build ${{ github.workspace }}/Sources/OpenDDSharp.Marshaller/OpenDDSharp.Marshaller.csproj -property:Configuration=Release -property:Platform=AnyCPU
working-directory: ${{ github.workspace }}
- name: Create release packages
shell: pwsh
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=Pack --MajorVersion=${{ env.GitVersion_Major }} --MinorVersion=${{ env.GitVersion_Minor }} --PatchVersion=${{ env.GitVersion_Patch }} --BuildNumber=${{ env.GitVersion_WeightedPreReleaseNumber }} --PreReleaseTag="${{ env.GitVersion_PreReleaseLabel }}" --BranchName="${{ steps.branch-name.outputs.current_branch }}"
working-directory: ${{ github.workspace }}/Build
- name: NuGet Artifacts
uses: actions/upload-artifact@v3
with:
name: openddsharp-nuget-${{ github.run_number }}
path: ${{ github.workspace }}/Release/*.nupkg
test_artifacts:
needs: build_artifacts
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
runtime: win-x86
- os: windows-latest
runtime: win-x64
- os: ubuntu-latest
runtime: linux-x64
- os: macos-latest
runtime: osx-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.12.0'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Download OpenDDSharp NuGets
uses: actions/download-artifact@v3
with:
name: openddsharp-nuget-${{ github.run_number }}
path: ${{ github.workspace }}/nupkg
- name: Test .NET development
shell: pwsh
run: |
dotnet nuget add source "${{ github.workspace }}/nupkg" --name LocalVersion
$version = "${{ env.GitVersion_Major }}.${{ env.GitVersion_Minor }}.${{ env.GitVersion_Patch }}"
if (-Not ([string]::IsNullOrWhiteSpace("${{ env.GitVersion_PreReleaseLabel }}"))) {
$version = "$version${{ env.GitVersion_PreReleaseLabelWithDash }}${{ env.GitVersion_WeightedPreReleaseNumber }}"
}
dotnet new --install "${{ github.workspace }}/nupkg/OpenDDSharp.Templates.$version.nupkg"
New-Item -Path "." -Name "Test" -ItemType "directory"
cd Test
dotnet new openddsharp-idl-project
Remove-Item ./IDL/Test.idl
Copy-Item "${{ github.workspace }}/Tests/TestIdlJson/IDL/Test.idl" -Destination "./IDL" -Force
Copy-Item "${{ github.workspace }}/Tests/TestIdlJson/IDL/TestInclude.idl" -Destination "./IDL" -Force
dotnet restore Test.csproj --source https://api.nuget.org/v3/index.json --source ${{ github.workspace }}/nupkg/ --no-cache
dotnet build Test.csproj --configuration Release --runtime ${{ matrix.runtime }} --self-contained --no-restore
dotnet clean Test.csproj
cd ..
New-Item -Path "." -Name "TestConsole" -ItemType "directory"
cd TestConsole
dotnet new openddsharp-console-app
Remove-Item Program.cs
Copy-Item "${{ github.workspace }}/Examples/ConsoleDemoCore/Program.cs" -Destination "."
dotnet add TestConsole.csproj reference ../Test/Test.csproj
dotnet restore TestConsole.csproj --source https://api.nuget.org/v3/index.json --source ${{ github.workspace }}/nupkg/ --no-cache
dotnet build TestConsole.csproj --configuration Release --runtime ${{ matrix.runtime }} --self-contained --no-restore
$publishFolder = "${{ github.workspace }}/Publish/"
$executable = "TestConsole"
if ([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Windows))
{
$publishFolder = "${{ github.workspace }}\Publish\"
$executable += ".exe"
}
dotnet publish TestConsole.csproj --output "$publishFolder" --configuration Release --runtime ${{ matrix.runtime }} --self-contained
cd ${{ github.workspace }}
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $publishFolder + $executable
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $false
$pinfo.UseShellExecute = $false
$pinfo.WorkingDirectory = "$publishFolder"
$pinfo.CreateNoWindow = $true
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$p.WaitForExit()
$stderr = $p.StandardError.ReadToEnd()
if ($stderr)
{
Write-Error "stderr: $stderr"
}
Write-Host "exit code: $($p.ExitCode)"
publish_artifacts:
needs: test_artifacts
if: ${{ github.event.inputs.publish == 'true' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Download OpenDDSharp NuGets
uses: actions/download-artifact@v3
with:
name: openddsharp-nuget-${{ github.run_number }}
path: ${{ github.workspace }}/Release
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v7
- name: Publish NuGet packages
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
shell: pwsh
run: ${{ github.workspace }}/Build/OpenDDSharp.Build.ps1 --target=Publish --NugetApiKey="$env:NUGET_API_KEY" --BranchName=${{ steps.branch-name.outputs.current_branch }}
working-directory: ${{ github.workspace }}/Build