Signed-off-by: Clemens Vasters <clemens@vasters.com>
This commit is contained in:
Clemens Vasters 2024-08-27 19:01:22 +02:00
Родитель 513c699a81
Коммит d0f698335a
5 изменённых файлов: 29 добавлений и 32 удалений

52
.github/workflows/main-ci-build.yml поставляемый
Просмотреть файл

@ -12,6 +12,7 @@ on:
jobs:
build:
permissions: write-all
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
@ -25,21 +26,16 @@ jobs:
mkdir artifacts
mkdir artifacts/build
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Mandatory to use the extract version from tag action
- name: Extract version from tag
uses: damienaicheh/extract-version-from-tag-action@v1.0.0
- name: Export version
run: |
echo "VERSIONSUFFIX=${{ env.PRE_RELEASE }}" >> $GITHUB_ENV
echo "PRODVERSION=${{ env.MAJOR }}.${{ env.MINOR }}" >> $GITHUB_ENV
echo "PATCHVERSION=${{ env.PATCH }}" >> $GITHUB_ENV
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
@ -49,30 +45,30 @@ jobs:
- name: Build Docker Image TAR file
run: |
mkdir -p artifacts/build/images
DOCKER_BUILDKIT=1 docker build . --build-arg "REVISION=${{ env.PRODVERSION }}.${{ env.PATCHVERSION }}" --build-arg "VERSION=${{ env.PRODVERSION }}" -t azbridge:${{ env.PRODVERSION }} -t azbridge
docker save azbridge:${{ env.PRODVERSION }} > artifacts/build/images/azbridge-oci-image-${{ env.PRODVERSION }}.${{ env.PATCHVERSION }}.tar
DOCKER_BUILDKIT=1 docker build . --build-arg "REVISION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" --build-arg "VERSION=${{ env.MAJOR }}.${{ env.MINOR }}" -t azbridge:${{ env.MAJOR }}.${{ env.MINOR }} -t azbridge
docker save azbridge:${{ env.MAJOR }}.${{ env.MINOR }} > artifacts/build/images/azbridge-oci-image-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.tar
if: matrix.os == 'ubuntu-latest'
- name: Build for Windows-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=true /p:RuntimeIdentifier=win-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Package /p:WindowsOnly=true /p:RuntimeIdentifier=win-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'windows-latest'
- name: Build for Windows-arm64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'windows-latest'
- name: Build for Windows-x86
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win-x86 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win-x86 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'windows-latest'
- name: Build for macOS-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'macos-latest'
- name: Build for macOS-arm64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=osx-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'macos-latest'
- name: Build for Linux-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=linux-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=linux-x64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'ubuntu-latest'
- name: Build for Linux-arm64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=linux-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=linux-arm64 /p:Configuration=Release /p:TargetFramework=net8.0 /p:VersionSuffix=rel /p:VersionPrefix=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
if: matrix.os == 'ubuntu-latest'
- name: Unit Test Windows x64
@ -95,28 +91,28 @@ jobs:
dotnet test /p:TargetFramework=net8.0 /p:RuntimeIdentifier=osx-arm64 /p:Configuration=Debug
if: matrix.os == 'macos-latest'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: XBuild
path: artifacts/build/net8.0
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: XBuild
path: artifacts/build/images
if: matrix.os == 'ubuntu-latest'
- name: Integration Tests Docker/Linux
env:
AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
run: bash ./verify-build.sh
if: matrix.os == 'ubuntu-latest'
#- name: Integration Tests Docker/Linux
# env:
# AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
# run: bash ./verify-build.sh
# if: matrix.os == 'ubuntu-latest'
- name: Integration Tests Windows
env:
AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
run: ./verify-build.cmd
if: matrix.os == 'windows-latest'
#- name: Integration Tests Windows
# env:
# AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
# run: ./verify-build.cmd
# if: matrix.os == 'windows-latest'
# create a release if a tag has been pushed
- name: Generate Release

Просмотреть файл

@ -4,7 +4,7 @@
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<PackagingTargetsPackageVersion>0.1.220</PackagingTargetsPackageVersion>
<WixPackageVersion>3.14.0</WixPackageVersion>
<WixPackageVersion>3.14.1</WixPackageVersion>
<MicrosoftDiagnosticsTracingEventSourcePackageVersion>1.1.28</MicrosoftDiagnosticsTracingEventSourcePackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.66</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftNETCoreAppPackageVersion>8.0.0</MicrosoftNETCoreAppPackageVersion>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\WiX.3.14.0\build\wix.props" Condition="Exists('packages\WiX.3.14.0\build\wix.props')" />
<Import Project="packages\WiX.3.14.1\build\wix.props" Condition="Exists('packages\WiX.3.14.1\build\wix.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ProductVersion>3.10</ProductVersion>
@ -98,7 +98,7 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\WiX.3.14.0\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WiX.3.14.0\build\wix.props'))" />
<Error Condition="!Exists('packages\WiX.3.14.1\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WiX.3.14.1\build\wix.props'))" />
</Target>
<Target Name="Publish" DependsOnTargets="Build">
</Target>

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WiX" version="3.14.0" targetFramework="net8.0" />
<package id="WiX" version="3.14.1" targetFramework="net8.0" />
</packages>

Просмотреть файл

@ -7,5 +7,6 @@
<VersionPrefix Condition="'$(PRODVERSION)'!=''">$(PRODVERSION).$(RunNumber)</VersionPrefix>
<VersionSuffix>rel</VersionSuffix>
<VersionSuffix Condition="'$(VERSIONSUFFIX)'!=''">$(VERSIONSUFFIX)</VersionSuffix>
<PackageVersion>$(VERSIONPREFIX)</PackageVersion>
</PropertyGroup>
</Project>