InkCanvasForClass/.github/workflows/main.yml

80 lines
2.1 KiB
YAML
Raw Normal View History

2022-09-10 13:34:36 +08:00
name: .NET Build
2022-09-10 11:57:35 +08:00
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
2022-09-10 13:34:36 +08:00
2022-09-10 11:57:35 +08:00
build:
runs-on: windows-latest
2022-09-10 13:34:36 +08:00
2022-09-10 11:57:35 +08:00
steps:
2022-09-10 13:34:36 +08:00
- name: Checkout
2023-04-23 15:15:45 +08:00
uses: actions/checkout@v3.5.2
2022-09-10 13:34:36 +08:00
with:
fetch-depth: 0
# 安装 .NET Core
- name: Install .NET Core
2023-04-23 15:15:45 +08:00
uses: actions/setup-dotnet@v3.0.3
2022-09-10 13:34:36 +08:00
with:
dotnet-version: '6.0.x'
# 安装 NuGet
- name: Setup NuGet
2023-04-23 15:15:45 +08:00
uses: NuGet/setup-nuget@v1.2.0
2022-09-10 13:34:36 +08:00
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
2023-04-23 15:15:45 +08:00
uses: microsoft/setup-msbuild@v1.3.1
2022-09-10 13:34:36 +08:00
# 编译整个项目
- name: Build the solution
run: |
msbuild -t:restore /p:GitFlow="Github Action"
2023-05-25 10:29:50 +08:00
msbuild -target:"Ink Canvas" /p:Configuration=Release /p:Platform="Any CPU" /p:GitFlow="Github Action"
2022-09-10 13:34:36 +08:00
env:
Configuration: ${{ matrix.configuration }}
- name: Build the solution (x64)
run: |
msbuild -t:restore /p:GitFlow="Github Action"
2023-05-25 10:29:50 +08:00
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"
2023-05-25 10:29:50 +08:00
msbuild -target:"Ink Canvas" /p:Configuration=Release /p:Platform="ARM64" /p:GitFlow="Github Action"
env:
Configuration: ${{ matrix.configuration }}
2022-09-10 13:46:32 +08:00
# 上传编译成品
2022-09-10 13:49:21 +08:00
- name: Upload to artifact
2022-09-10 13:46:32 +08:00
uses: actions/upload-artifact@main
with:
name: Ink-Canvas
path: Ink Canvas/bin/Release
- name: Upload to artifact (x64)
uses: actions/upload-artifact@main
with:
2023-04-25 12:50:48 +08:00
name: Ink-Canvas-x64
path: Ink Canvas/bin/x64/Release
- name: Upload to artifact (ARM64)
uses: actions/upload-artifact@main
with:
2023-04-25 12:50:48 +08:00
name: Ink-Canvas-ARM64
path: Ink Canvas/bin/ARM64/Release