Skip to content

Commit

Permalink
Build switch to Windows (#53)
Browse files Browse the repository at this point in the history
Matrix build for creating MSIs on Windows
  • Loading branch information
clemensv committed Sep 15, 2022
1 parent 6d48dc5 commit 21dc8d1
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/main-ci-build.yml
Expand Up @@ -12,8 +12,13 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
windows: true
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
Expand All @@ -28,7 +33,6 @@ jobs:
echo "VERSIONSUFFIX=${{ env.PRE_RELEASE }}" >> $GITHUB_ENV
echo "PRODVERSION=${{ env.MAJOR }}.${{ env.MINOR }}" >> $GITHUB_ENV
echo "PATCHVERSION=${{ env.PATCH }}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
Expand All @@ -39,40 +43,56 @@ jobs:
run: dotnet restore

- name: Build for Windows 10-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=win10-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
run: dotnet msbuild /t:Package /p:WindowsOnly=true /p:RuntimeIdentifier=win10-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'windows-latest'
- name: Build for Windows 10-arm64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win10-arm /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'windows-latest'
- name: Build for Windows 10-x86
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=win10-x86 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
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=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Ubuntu 18-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=ubuntu.18.04-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Ubuntu 18-arm64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=ubuntu.18.04-arm64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Ubuntu 20-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=ubuntu.20.04-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Ubuntu 20-arm64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=ubuntu.20.04-arm64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Debian 10-x64
run: dotnet msbuild /t:Package /p:WindowsOnly=false /p:RuntimeIdentifier=debian.10-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for OpenSUSE 15-x64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=opensuse.15.0-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'
- name: Build for Fedora 30-x64
run: dotnet msbuild /t:Restore,Package /p:WindowsOnly=false /p:RuntimeIdentifier=fedora.34-x64 /p:Configuration=Release /p:TargetFramework=net6.0 /p:VersionSuffix=rel
if: matrix.os == 'ubuntu-latest'

- name: Test
run: dotnet test /p:TargetFramework=net6.0 /p:RuntimeIdentifier=ubuntu-x64 /p:Configuration=Debug
- name: Unit Test Windows x64
run: dotnet test /p:TargetFramework=net6.0 /p:RuntimeIdentifier=win10-x64 /p:Configuration=Debug
if: matrix.os == 'windows-latest'
- name: Unit Test Windows x64
run: dotnet test /p:TargetFramework=net6.0 /p:RuntimeIdentifier=ubuntu.20.04-x64 /p:Configuration=Debug
if: matrix.os == 'ubuntu-latest'

- uses: actions/upload-artifact@v2
with:
name: XBuild
path: artifacts/build/net6.0

- name: Integration
- name: Integration Tests Docker/Linux
env:
AZBRIDGE_TEST_CXNSTRING: ${{ secrets.AZBRIDGE_TEST_CXNSTRING }}
run: bash ./verify-build.sh
if: matrix.os == 'ubuntu-latest'

# create a release if a tag has been pushed
- name: Generate Release
Expand Down

0 comments on commit 21dc8d1

Please sign in to comment.