-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (121 loc) · 3.52 KB
/
Copy pathbuild.yml
File metadata and controls
147 lines (121 loc) · 3.52 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
check-frontend:
name: Check Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install
working-directory: ChuChartManager/Front
run: pnpm install
- name: Type Check
working-directory: ChuChartManager/Front
run: pnpm vue-tsc --noEmit
- name: Build
working-directory: ChuChartManager/Front
run: pnpm build
- name: Upload wwwroot
uses: actions/upload-artifact@v4
with:
name: wwwroot
path: ChuChartManager/wwwroot
check-backend:
name: Check Backend
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Build
run: dotnet build ChuChartManager/ChuChartManager.csproj -c Release
build:
name: Build (zip)
runs-on: windows-latest
needs: [check-frontend, check-backend]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
dotnet-quality: "preview"
- name: Build Frontend
working-directory: ChuChartManager/Front
run: |
pnpm install
pnpm build
- name: Publish
run: dotnet publish ChuChartManager/ChuChartManager.csproj -c Release -r win-x64 --self-contained -o publish /p:PublishSingleFile=false /p:ErrorOnDuplicatePublishOutputFiles=false
- name: Package
shell: pwsh
run: Compress-Archive -Path publish/* -DestinationPath ChuChartManager-win-x64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ChuChartManager-win-x64
path: ChuChartManager-win-x64.zip
build-canary-appx:
name: Build Canary Appx
runs-on: self-hosted
needs: [check-frontend]
steps:
- run: git config --global core.longPaths true
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Download wwwroot
uses: actions/download-artifact@v4
with:
name: wwwroot
path: ChuChartManager/wwwroot
- name: Build Appx
shell: pwsh
# self-hosted runner 已配 .NET SDK / Windows SDK / D:\Sign\signcode.cmd
run: .\Packaging\Build.ps1 -Mode Canary
- name: Upload Appx
uses: actions/upload-artifact@v4
with:
name: ChuChartManager-Canary-Appx
path: Packaging/ChuChartManager_Canary_*.appx
release:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: ChuChartManager-win-x64
- uses: softprops/action-gh-release@v2
with:
files: ChuChartManager-win-x64.zip
generate_release_notes: true
prerelease: false