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
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
# 安装 .NET Core
|
|
|
|
- name: Install .NET Core
|
|
|
|
uses: actions/setup-dotnet@v2
|
|
|
|
with:
|
|
|
|
dotnet-version: '6.0.x'
|
|
|
|
|
|
|
|
# 安装 NuGet
|
|
|
|
- name: Setup NuGet
|
|
|
|
uses: nuget/setup-nuget@v1
|
|
|
|
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.0.2
|
|
|
|
|
|
|
|
# 编译整个项目
|
|
|
|
- name: Build the solution
|
|
|
|
run: |
|
|
|
|
msbuild -t:restore
|
|
|
|
msbuild /p:Configuration=Release /p:Platform="Any CPU"
|
|
|
|
env:
|
|
|
|
Configuration: ${{ matrix.configuration }}
|