From 6dc55bbb8a40dd385c51a02f7b1f8c0eb3150026 Mon Sep 17 00:00:00 2001 From: ChangSakura <90511645+ChangSakura@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:56:39 +0800 Subject: [PATCH] Create dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/dotnet-desktop.yml diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..fe3e96e --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,79 @@ +name: .NET Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + with: + fetch-depth: 0 + + # 安装 .NET Core + - name: Install .NET Core + uses: actions/setup-dotnet@v3.0.3 + with: + dotnet-version: '6.0.x' + + # 安装 NuGet + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.2.0 + with: + nuget-version: '5.x' + + # 还原 NuGet 包 + - name: NuGet restore + run: nuget restore + + # 添加 MSBuild.exe 到环境变量: https://github.com/microsoft/setup-msbuild + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.3.1 + + # 编译整个项目 + - name: Build the solution + run: | + msbuild -t:restore /p:GitFlow="Github Action" + msbuild -target:"Ink Canvas" /p:Configuration=Release /p:Platform="Any CPU" /p:GitFlow="Github Action" + env: + Configuration: ${{ matrix.configuration }} + + - name: Build the solution (x64) + run: | + msbuild -t:restore /p:GitFlow="Github Action" + msbuild -target:"Ink Canvas" /p:Configuration=Release /p:Platform="x64" /p:GitFlow="Github Action" + env: + Configuration: ${{ matrix.configuration }} + + - name: Build the solution (ARM64) + run: | + msbuild -t:restore /p:GitFlow="Github Action" + msbuild -target:"Ink Canvas" /p:Configuration=Release /p:Platform="ARM64" /p:GitFlow="Github Action" + env: + Configuration: ${{ matrix.configuration }} + + # 上传编译成品 + - name: Upload to artifact + uses: actions/upload-artifact@main + with: + name: Ink Canvas Annotation + path: Ink-Canvas-For-Annotation/bin/Release + + - name: Upload to artifact (x64) + uses: actions/upload-artifact@main + with: + name: Ink Canvas Annotation-x64 + path: Ink-Canvas-For-Annotation/bin/x64/Release + + - name: Upload to artifact (ARM64) + uses: actions/upload-artifact@main + with: + name: Ink Canvas Annotation-ARM64 + path: Ink-Canvas-For-Annotation/bin/ARM64/Release