-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (44 loc) · 1.45 KB
/
build-dotnet.yml
File metadata and controls
53 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build .NET Framework
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages and Build .NET Framework
run: msbuild 渔人的直感.sln /restore /p:Configuration=Release
- name: Create temp directory and move files
run: |
mkdir temp_artifact
cp 渔人的直感/bin/Release/渔人的直感.exe temp_artifact/
cp 渔人的直感/Wav/* temp_artifact/
- name: Upload artifacts
if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4 # 更新为 v4
with:
name: FishersIntuition
path: temp_artifact/*
- name: Zip release files
if: startsWith(github.ref, 'refs/tags/v')
run: powershell Compress-Archive -Path temp_artifact/* -DestinationPath FishersIntuition-${{ github.ref_name }}.zip
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
name: "渔人的直感 ${{ github.ref_name }}"
tag_name: ${{ github.ref_name }}
files: FishersIntuition-${{ github.ref_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}