Create sync.yml #260
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# 安装 .NET Core | |
- name: Install .NET Core | |
uses: actions/[email protected] | |
with: | |
dotnet-version: '6.0.x' | |
# 安装 NuGet | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
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/[email protected] | |
# 编译整个项目 | |
- 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 | |
path: Ink Canvas/bin/Release | |
- name: Upload to artifact (x64) | |
uses: actions/upload-artifact@main | |
with: | |
name: Ink-Canvas-x64 | |
path: Ink Canvas/bin/x64/Release | |
- name: Upload to artifact (ARM64) | |
uses: actions/upload-artifact@main | |
with: | |
name: Ink-Canvas-ARM64 | |
path: Ink Canvas/bin/ARM64/Release |