forked from SereinDev/Serein
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.88 KB
/
Build.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build
on:
push:
paths:
- "**.cs"
pull_request:
workflow_dispatch:
jobs:
BuildForWindows:
runs-on: windows-latest
strategy:
matrix:
project: [WPF]
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Write Build info
shell: cmd
run: |
cmd /c echo GITHUB ACTION #${{github.run_number}} >${{ github.workspace }}\Hakuu\Universal\buildinfo.info
cmd /c echo %date% %time% >>${{ github.workspace }}\Hakuu\Universal\buildinfo.info
cmd /c echo ${{github.ref}} ${{github.sha}}>>${{ github.workspace }}\Hakuu\Universal\buildinfo.info
- name: DotNet restore
run: dotnet restore
- name: Build the project(Release)
run: dotnet build -p:Configuration=Release "Hakuu/${{ matrix.project }}/Hakuu-${{ matrix.project }}.csproj"
- name: Build the project(Debug)
run: dotnet build "Hakuu/${{ matrix.project }}/Hakuu-${{ matrix.project }}.csproj"
- name: Upload Hakuu(Release,dotnet6-windows)
uses: actions/upload-artifact@v3
with:
name: Hakuu_${{ matrix.project }}_dotnet6
path: ${{ github.workspace }}\Hakuu\${{ matrix.project }}\bin\Release\net6.0-windows
if-no-files-found: ignore
- name: Upload Hakuu(Release,dotnetframework472)
uses: actions/upload-artifact@v3
with:
name: Hakuu_${{ matrix.project }}_dotnetframework472
path: ${{ github.workspace }}\Hakuu\${{ matrix.project }}\bin\Release\net472
if-no-files-found: ignore
- name: Upload Hakuu(Debug,dotnet6-windows)
uses: actions/upload-artifact@v3
with:
name: Hakuu_${{ matrix.project }}_dotnet6_debug
path: ${{ github.workspace }}\Hakuu\${{ matrix.project }}\bin\Debug\net6.0-windows
if-no-files-found: ignore
- name: Upload Hakuu(Debug,dotnetframework472)
uses: actions/upload-artifact@v3
with:
name: Hakuu_${{ matrix.project }}_dotnetframework472_debug
path: ${{ github.workspace }}\Hakuu\${{ matrix.project }}\bin\Debug\net472
if-no-files-found: ignore
- name: Build the project(Publish)
run: |
dotnet clean
dotnet publish "Hakuu/${{ matrix.project }}/Hakuu-${{ matrix.project }}.csproj" -f net6.0-windows --no-self-contained -p:PublishSingleFile=true -p:RuntimeIdentifier=win-x64 -p:IncludeContentInSingleFile=true
- name: Upload Hakuu(Publish)
uses: actions/upload-artifact@v3
with:
name: Hakuu_${{ matrix.project }}_dotnet6_publish
path: ${{ github.workspace }}\Hakuu\${{ matrix.project }}\bin\Debug\net6.0-windows\win-x64\publish
if-no-files-found: ignore