Continuous Delivery #347
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.28.1" | |
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 | |
- 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 '${{ matrix.BuildPlatform }}' -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 '${{ matrix.BuildPlatform }}' -Channel 7.0; | |
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Setup dotnet 8.0 | |
shell: pwsh | |
run: | | |
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'; | |
./dotnet-install.ps1 -Architecture '${{ matrix.BuildPlatform }}' -Channel 8.0; | |
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: ${{ matrix.BuildPlatform }} | |
- name: Cache OpenDDS libraries | |
id: opendds-libraries-windows-cd | |
uses: actions/cache@v4 | |
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 | |
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/ACE_wrappers/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_${{ matrix.BuildPlatform }}/ACE_wrappers/TAO/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 ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\ACE_wrappers\VERSION.txt" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\ACE_wrappers\" /D /S /Y /M | |
XCOPY ".\ext\OpenDDS_${{ matrix.BuildPlatform }}\ACE_wrappers\TAO\VERSION.txt" "$targetDir\OpenDDS_${{ matrix.BuildPlatform }}\ACE_wrappers\" /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@v4 | |
with: | |
name: opendds-win-${{ matrix.BuildPlatform }}-${{ github.run_number }} | |
path: ${{ github.workspace }}/opendds-native-win-${{ matrix.BuildPlatform }}.zip | |
build_linux_native: | |
runs-on: ubuntu-20.04 | |
env: | |
BuildPlatform: "x64" | |
BuildConfiguration: "Release" | |
LD_RPATH_FLAGS: "-Wl,-E '-Wl,-rpath,$$ORIGIN'" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet 6.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 6.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 7.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 7.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 8.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 8.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Cache OpenDDS libraries | |
id: opendds-libraries-linux-cd | |
uses: actions/cache@v4 | |
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 | |
${{ github.workspace }}/ext/OpenDDS_Linux/ACE_wrappers/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_Linux/ACE_wrappers/TAO/VERSION.txt | |
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 -L --include='ACE_wrappers/VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir | |
rsync -r -m -v -L --include='ACE_wrappers/TAO/VERSION.txt' --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@v4 | |
with: | |
name: opendds-linux-x64-${{ github.run_number }} | |
path: ${{ github.workspace }}/opendds-native-linux-x64.zip | |
build_macos_x64_native: | |
runs-on: macos-13 | |
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 | |
- name: Setup dotnet 6.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 6.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 7.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 7.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 8.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 8.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Cache OpenDDS libraries | |
id: opendds-libraries-macos-x64-cd | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }}/README.md | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/cmake/**/* | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/tools/rapidjson/**/* | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.pl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/lib*.dylib | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/bin/ | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/ACE_wrappers/bin/ | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/dds/idl/IDLTemplate.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.h | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.hpp | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.cpp | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.inl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.idl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/**/*.pidl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/tools/ | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/dds/InfoRepo/DCPSInfoRepo | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/dds/idl/opendds_idl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/ACE_wrappers/apps/gperf/src/ace_gperf | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/ACE_wrappers/TAO/TAO_IDL/tao_idl | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/ACE_wrappers/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-x64/ACE_wrappers/TAO/VERSION.txt | |
key: opendds-cache-${{ env.OpenDdsVersion }}-osx-${{ env.BuildPlatform }}-cd | |
- name: Build Native (No cached) | |
shell: pwsh | |
if: steps.opendds-libraries-macos-x64-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-x64-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_osx-x64" | |
$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 -L --include='ACE_wrappers/VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir | |
rsync -r -m -v -L --include='ACE_wrappers/TAO/VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir | |
rsync -r -m -v --include='README.md' --include='*/' --exclude='*' ./ $targetDir | |
rsync -r -m -v --include='Native/build_osx-x64/OpenDDSWrapper/libOpenDDSWrapper.dylib' --include='*/' --exclude='*' ./ $targetDir | |
rsync -r -m -v --include='Native/build_osx-x64/OpenDDSharp.IdlGenerator/openddsharp_idl' --include='*/' --exclude='*' ./ $targetDir | |
ls -la ./opendds-native-osx-x64 | |
ls -la ./opendds-native-osx-x64/OpenDDS_osx-x64 | |
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@v4 | |
with: | |
name: opendds-osx-x64-${{ github.run_number }} | |
path: ${{ github.workspace }}/opendds-native-osx-x64.zip | |
build_macos_arm64_native: | |
runs-on: macos-14 | |
env: | |
BuildPlatform: "ARM64" | |
BuildConfiguration: "Release" | |
LD_RPATH_FLAGS: "-Wl,-rpath,@executable_path -Wl,-rpath,@loader_path" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet 6.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 6.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 7.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 7.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Setup dotnet 8.0 | |
shell: sh | |
run: | | |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --architecture '${{ env.BuildPlatform }}' --channel 8.0 | |
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc | |
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc | |
- name: Cache OpenDDS libraries | |
id: opendds-libraries-macos-arm64-cd | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ github.workspace }}/README.md | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/cmake/**/* | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/tools/rapidjson/**/* | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.pl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/lib*.dylib | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/bin/ | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/ACE_wrappers/bin/ | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/dds/idl/IDLTemplate.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.h | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.hpp | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.cpp | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.inl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.idl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/**/*.pidl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/tools/ | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/dds/InfoRepo/DCPSInfoRepo | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/dds/idl/opendds_idl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/ACE_wrappers/apps/gperf/src/ace_gperf | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/ACE_wrappers/TAO/TAO_IDL/tao_idl | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/ACE_wrappers/VERSION.txt | |
${{ github.workspace }}/ext/OpenDDS_osx-arm64/ACE_wrappers/TAO/VERSION.txt | |
key: opendds-cache-${{ env.OpenDdsVersion }}-osx-${{ env.BuildPlatform }}-cd | |
- name: Build Native (No cached) | |
shell: pwsh | |
if: steps.opendds-libraries-macos-ARM64-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-ARM64-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_osx-arm64" | |
$targetDir = "./opendds-native-osx-arm64" | |
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 -L --include='ACE_wrappers/VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir | |
rsync -r -m -v -L --include='ACE_wrappers/TAO/VERSION.txt' --include='*/' --exclude='*' $sourceDir $targetDir | |
rsync -r -m -v --include='README.md' --include='*/' --exclude='*' ./ $targetDir | |
rsync -r -m -v --include='Native/build_osx-arm64/OpenDDSWrapper/libOpenDDSWrapper.dylib' --include='*/' --exclude='*' ./ $targetDir | |
rsync -r -m -v --include='Native/build_osx-arm64/OpenDDSharp.IdlGenerator/openddsharp_idl' --include='*/' --exclude='*' ./ $targetDir | |
ls -la ./opendds-native-osx-arm64 | |
ls -la ./opendds-native-osx-arm64/OpenDDS_osx-arm64 | |
ls -la ./opendds-native-osx-arm64/Native | |
zip -r "opendds-native-osx-arm64.zip" "./opendds-native-osx-arm64" | |
- name: Artifacts OpenDDS libraries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: opendds-osx-ARM64-${{ github.run_number }} | |
path: ${{ github.workspace }}/opendds-native-osx-arm64.zip | |
build_artifacts: | |
runs-on: windows-latest | |
needs: [build_windows_native, build_linux_native, build_macos_x64_native, build_macos_arm64_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 8.0 | |
shell: pwsh | |
run: | | |
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'; | |
./dotnet-install.ps1 -Architecture 'x64' -Channel 8.0; | |
echo "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1 | |
with: | |
versionSpec: '5.12.0' | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v1 | |
with: | |
useConfigFile: true | |
- name: Get branch names | |
id: branch-name | |
uses: tj-actions/branch-names@v8 | |
- name: Download OpenDDS Native win-x86 | |
uses: actions/download-artifact@v4 | |
with: | |
name: opendds-win-x86-${{ github.run_number }} | |
- name: Download OpenDDS Native win-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: opendds-win-x64-${{ github.run_number }} | |
- name: Download OpenDDS Native linux-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: opendds-linux-x64-${{ github.run_number }} | |
- name: Download OpenDDS Native osx-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: opendds-osx-x64-${{ github.run_number }} | |
- name: Download OpenDDS Native osx-arm64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: opendds-osx-ARM64-${{ 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 "." | |
Expand-Archive -Path "${{ github.workspace }}\opendds-native-osx-arm64.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_osx-x64\*" "${{ github.workspace }}\ext\OpenDDS_osx-x64\" /D /S /Y /M | |
XCOPY ".\opendds-native-osx-x64\Native\*" "${{ github.workspace }}\Native\" /D /S /Y /M | |
XCOPY ".\opendds-native-osx-ARM64\OpenDDS_osx-arm64\*" "${{ github.workspace }}\ext\OpenDDS_osx-arm64\" /D /S /Y /M | |
XCOPY ".\opendds-native-osx-ARM64\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@v4 | |
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-20.04 | |
runtime: linux-x64 | |
- os: ubuntu-22.04 | |
runtime: linux-x64 | |
- os: macos-13 | |
runtime: osx-x64 | |
- os: macos-14 | |
runtime: osx-arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '6.0.x' | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v1 | |
with: | |
versionSpec: '5.12.0' | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v1 | |
with: | |
useConfigFile: true | |
- name: Download OpenDDSharp NuGets | |
uses: actions/download-artifact@v4 | |
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@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Download OpenDDSharp NuGets | |
uses: actions/download-artifact@v4 | |
with: | |
name: openddsharp-nuget-${{ github.run_number }} | |
path: ${{ github.workspace }}/Release | |
- name: Get branch names | |
id: branch-name | |
uses: tj-actions/branch-names@v8 | |
- 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 |