forked from xiaoyaocz/biliuwp-lite
-
Notifications
You must be signed in to change notification settings - Fork 39
293 lines (254 loc) · 13.2 KB
/
release.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
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "版本号"
required: true
default: "0.0.0.0"
enableX64:
description: "启用x64"
required: true
default: true
type: boolean
enableX64Native:
description: "启用x64Native"
required: true
default: true
type: boolean
enableX86:
description: "启用x86"
required: true
default: false
type: boolean
enableArm64:
description: "启用Arm64"
required: true
default: true
type: boolean
enableArm32:
description: "启用Arm32"
required: true
default: false
type: boolean
jobs:
release:
runs-on: windows-latest
env:
SigningCertificate: BiliLite.UWP_TemporaryKey.pfx
SigningCertificatePasswd: ${{ secrets.SIGNING_CERTIFICATE_PASSWD }}
Solution_Path: .\BiliLite.sln
AppName: BiliLite.Packages
UWP_Project_Directory: src\BiliLite.Packages
UWP_Project_Path: src\BiliLite.UWP\BiliLite.UWP.csproj
UWP_X64_Native_Project_Path: src\BiliLite.UWP\BiliLite.UWP.csproj.native
Win32_Project_Path: src\BiliLite.Win32Tools\BiliLite.Win32Tools.csproj
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
Webdav_addr: ${{ secrets.WEBDAV_ADDR }}
Webdav_auth: ${{ secrets.WEBDAV_AUTH }}
nuget_package_addr: ${{ secrets.NUGET_PACKAGE_ADDR }}
nuget_package: biliuwp-lite-nuget-packages.zip
steps:
- name: Configure Pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: EchoInput
run: |
echo 启用x64编译 ${{ github.event.inputs.enableX64 }}
echo 启用x86编译 ${{ github.event.inputs.enableX86 }}
echo 启用Arm64编译 ${{ github.event.inputs.enableArm64 }}
echo 启用Arm编译 ${{ github.event.inputs.enableArm32 }}
- name: Download and process necessary files
run: |
curl --location $env:Webdav_addr --header "$env:Webdav_auth" -o "$env:UWP_Project_Directory/$env:SigningCertificate" --insecure
curl --location $env:nuget_package_addr --header "$env:Webdav_auth" -o "$env:nuget_package" --insecure
Expand-Archive -path $env:nuget_package -DestinationPath ./
cp -r ./packages ./src/
- uses: release-drafter/release-drafter@v5
name: Create release draft
id: release-drafter
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Windows SDK Install
uses: ChristopheLav/[email protected]
with:
version-sdk: 18362
features: "OptionId.WindowsPerformanceToolkit,OptionId.WindowsDesktopDebuggers,OptionId.AvrfExternal,OptionId.NetFxSoftwareDevelopmentKit,OptionId.WindowsSoftwareLogoToolkit,OptionId.IpOverUsb,OptionId.MSIInstallTools,OptionId.SigningTools,OptionId.UWPManaged,OptionId.UWPCPP,OptionId.UWPLocalized,OptionId.DesktopCPPx86,OptionId.DesktopCPPx64,OptionId.DesktopCPParm,OptionId.DesktopCPParm64"
- name: Update manifest version
run: |
[xml]$manifest = get-content ".\$env:UWP_Project_Directory\Package.appxmanifest"
$manifest.Package.Identity.Version = "${{github.event.inputs.version}}"
$manifest.save(".\$env:UWP_Project_Directory\Package.appxmanifest")
- name: Create Package Directory
run: New-Item -ItemType Directory -Path C:\Package
- name: document processing
run: |
git clone https://github.com/ywmoyue/OnlinePageToPDF-Node.git
cd OnlinePageToPDF-Node
npm install
node index.js --waitTime=35000 --pageUrl="http://markdown.muyan233.top:352/?fileUrl=https%3A%2F%2Fraw.githubusercontent.com%2Fywmoyue%2Fbiliuwp-lite%2Fdev%2Fdocument%2Finstall-readme.md" --pdfFilePath="安装教程.pdf"
cd ..
cp ./OnlinePageToPDF-Node/安装教程.pdf C:\Package\安装教程.pdf
- name: Build x64
run: |
msbuild $env:UWP_Project_Directory /p:Platform=x64 /p:Configuration=Release /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:SigningCertificatePasswd /restore
env:
BuildMode: SideloadOnly
Configuration: Release
if: github.event.inputs.enableX64 == 'true'
- name: copy x64 document
run: cp C:\Package\安装教程.pdf ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test\安装教程.pdf
if: github.event.inputs.enableX64 == 'true'
- name: Remove x64 useless files
run: |
cd ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test
rm -r -fo *.appxsym
cd Dependencies
rm -r -fo arm,arm64,x86
if: github.event.inputs.enableX64 == 'true'
- name: Create x64 archive
run: Compress-Archive -Path ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test -DestinationPath C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x64.zip
if: github.event.inputs.enableX64 == 'true'
- name: Update x64 release asset
id: upload-release-asset-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
if: github.event.inputs.enableX64 == 'true'
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x64.zip
asset_name: ${{env.AppName}}_${{github.event.inputs.version}}_x64.zip
asset_content_type: application/zip
- name: Set x64 native
run: |
./scripts/setNative.ps1 -csprojPath $env:UWP_Project_Path
if: github.event.inputs.enableX64Native == 'true'
- name: Build x64 native
run: |
msbuild $env:UWP_Project_Directory /p:Platform=x64 /p:Configuration=Release /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:SigningCertificatePasswd /restore /p:Use64BitCompiler=true
env:
BuildMode: SideloadOnly
Configuration: Release
if: github.event.inputs.enableX64Native == 'true'
- name: copy x64 native document
run: cp C:\Package\安装教程.pdf ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test\安装教程.pdf
if: github.event.inputs.enableX64Native == 'true'
- name: Remove x64 native useless files
run: |
cd ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test
rm -r -fo *.appxsym
cd Dependencies
rm -r -fo arm,arm64,x86
if: github.event.inputs.enableX64Native == 'true'
- name: Create x64 native archive
run: Compress-Archive -Path ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x64_Test -DestinationPath C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x64_native.zip
if: github.event.inputs.enableX64Native == 'true'
- name: Update x64 native release asset
id: upload-release-asset-x64-native
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
if: github.event.inputs.enableX64Native == 'true'
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x64_native.zip
asset_name: ${{env.AppName}}_${{github.event.inputs.version}}_x64_native.zip
asset_content_type: application/zip
- name: Build x86
run: msbuild $env:UWP_Project_Directory /p:Platform=x86 /p:Configuration=Release /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:SigningCertificatePasswd /restore
if: github.event.inputs.enableX86 == 'true'
env:
BuildMode: SideloadOnly
Configuration: Release
- name: copy x86 document
run: cp C:\Package\安装教程.pdf ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x86_Test\安装教程.pdf
if: github.event.inputs.enableX86 == 'true'
- name: Remove x86 useless files
run: |
cd ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x86_Test
rm -r -fo *.appxsym
cd Dependencies
rm -r -fo arm,arm64,x64
if: github.event.inputs.enableX86 == 'true'
- name: Create x86 archive
run: Compress-Archive -Path ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_x86_Test -DestinationPath C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x86.zip
if: github.event.inputs.enableX86 == 'true'
- name: Update x86 release asset
id: upload-release-asset-x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
if: github.event.inputs.enableX86 == 'true'
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_x86.zip
asset_name: ${{env.AppName}}_${{github.event.inputs.version}}_x86.zip
asset_content_type: application/zip
- name: Build ARM64
run: msbuild $env:UWP_Project_Directory /p:Platform=ARM64 /p:Configuration=Release /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:SigningCertificatePasswd /restore
if: github.event.inputs.enableArm64 == 'true'
env:
BuildMode: SideloadOnly
Configuration: Release
- name: copy arm64 document
run: cp C:\Package\安装教程.pdf ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM64_Test\安装教程.pdf
if: github.event.inputs.enableArm64 == 'true'
- name: Remove arm64 useless files
run: |
cd ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM64_Test
rm -r -fo *.appxsym
cd Dependencies
rm -r -fo arm,x64,x86
if: github.event.inputs.enableArm64 == 'true'
- name: Create ARM64 archive
run: Compress-Archive -Path ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM64_Test -DestinationPath C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_ARM64.zip
if: github.event.inputs.enableArm64 == 'true'
- name: Update ARM64 release asset
id: upload-release-asset-ARM64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
if: github.event.inputs.enableArm64 == 'true'
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_ARM64.zip
asset_name: ${{env.AppName}}_${{github.event.inputs.version}}_ARM64.zip
asset_content_type: application/zip
- name: Build ARM32
run: msbuild $env:UWP_Project_Directory /p:Platform=ARM /p:Configuration=Release /p:PackageCertificateKeyFile=$env:SigningCertificate /p:PackageCertificatePassword=$env:SigningCertificatePasswd /restore
if: github.event.inputs.enableArm32 == 'true'
env:
BuildMode: SideloadOnly
Configuration: Release
- name: copy arm32 document
run: cp C:\Package\安装教程.pdf ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM_Test\安装教程.pdf
if: github.event.inputs.enableArm32 == 'true'
- name: Remove arm32 useless files
run: |
cd ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM_Test
rm -r -fo *.appxsym
cd Dependencies
rm -r -fo arm64,x64,x86
if: github.event.inputs.enableArm32 == 'true'
- name: Create ARM32 archive
run: Compress-Archive -Path ${{env.UWP_Project_Directory}}\AppPackages\${{env.AppName}}_${{github.event.inputs.version}}_ARM_Test -DestinationPath C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_ARM.zip
if: github.event.inputs.enableArm32 == 'true'
- name: Update ARM32 release asset
id: upload-release-asset-ARM32
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
if: github.event.inputs.enableArm32 == 'true'
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\${{env.AppName}}_${{github.event.inputs.version}}_ARM.zip
asset_name: ${{env.AppName}}_${{github.event.inputs.version}}_ARM.zip
asset_content_type: application/zip