From c8926b1b7c959ed02100d4823ea49e9df079f6c6 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 20 Nov 2021 18:33:11 +0100 Subject: [PATCH] Add UWP builds to Ci script --- .github/workflows/dotnet.yml | 72 +++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 53ecd86c..32a0bf99 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -201,7 +201,7 @@ jobs: run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed" shell: cmd - # Build the WinUI panel project + # Build the WinUI project build-project-winui: runs-on: windows-2022 steps: @@ -235,10 +235,7 @@ jobs: with: dotnet-version: 6.0.x - name: Build - run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:restore,build /p:Configuration=Release - shell: cmd - - name: Pack - run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:pack /p:Configuration=Release /p:ContinuousIntegrationBuild=True + run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:restore,build,pack /p:Configuration=Release /p:ContinuousIntegrationBuild=True shell: cmd - name: Upload package artifact uses: actions/upload-artifact@v2 @@ -265,4 +262,67 @@ jobs: shell: cmd - name: Build ComputeSharp.SwapChain.WinUI sample run: msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj -t:build /p:Configuration=Release /p:Platform=x64 - shell: cmd # the build of the sample has to be a separate step, as '-t:restore,build' causes the build to fail \ No newline at end of file + shell: cmd # the build of the sample has to be a separate step, as '-t:restore,build' causes the build to fail + + # Build the UWP project + build-project-uwp: + runs-on: windows-2022 + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.3 + with: + vs-prerelease: true + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Build + run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj -t:restore,build /p:Configuration=Release + shell: cmd + + # Build the UWP project again to generate a NuGet package from it. + # This workflow also uploads the resulting package as an artifact, like the WinUI one. + build-package-uwp: + if: success() + needs: [build-project-uwp] + runs-on: windows-2022 + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.3 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Build + run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj -t:restore,build,pack /p:Configuration=Release /p:ContinuousIntegrationBuild=True + shell: cmd + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: ComputeSharp.Uwp.nupkg + path: src\ComputeSharp.Uwp\bin\Release\*.nupkg + + # Build the local UWP sample to ensure it builds with no errors + build-samples-uwp: + if: success() + needs: [build-project-uwp] + runs-on: windows-2022 + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.3 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore ComputeSharp.SwapChain.Uwp sample + run: msbuild samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj -t:restore /p:Configuration=Release /p:Platform=x64 + shell: cmd + - name: Build ComputeSharp.SwapChain.Uwp sample + run: msbuild samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj -t:build /p:Configuration=Release /p:Platform=x64 + shell: cmd \ No newline at end of file