This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 507
106 lines (88 loc) · 3.92 KB
/
release-builder.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
name: Release Builder
on:
workflow_dispatch:
inputs:
version:
description: '版本号(不含v)'
required: true
default: '0.0.0.0'
jobs:
release:
runs-on: windows-latest
env:
SigningCertificate: App_TemporaryKey.pfx
Solution_Path: .\Bili.Uwp.sln
UWP_Project_Directory: src\App
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
- uses: release-drafter/release-drafter@v5
name: Create release draft
id: release-drafter
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- 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: Build x86
run: msbuild $env:Solution_Path /p:Platform=x86 /p:AppxBundlePlatforms="x86" /p:AppxPackageDir=C:\Package\x86 /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
BuildMode: SideloadOnly
Configuration: Release
- name: Build x64
run: msbuild $env:Solution_Path /p:Platform=x64 /p:AppxBundlePlatforms="x64" /p:AppxPackageDir=C:\Package\x64 /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
BuildMode: SideloadOnly
Configuration: Release
- name: Build ARM64
run: msbuild $env:Solution_Path /p:Platform=ARM64 /p:AppxBundlePlatforms="ARM64" /p:AppxPackageDir=C:\Package\ARM64 /p:PackageCertificateKeyFile=$env:SigningCertificate /restore
env:
BuildMode: SideloadOnly
Configuration: Release
- name: Create x86 archive
run: Compress-Archive -Path C:\Package\x86\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x86.zip
- name: Create x64 archive
run: Compress-Archive -Path C:\Package\x64\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x64.zip
- name: Create ARM64 archive
run: Compress-Archive -Path C:\Package\ARM64\App_${{github.event.inputs.version}}_Test -DestinationPath C:\Package\Bili.Uwp_${{github.event.inputs.version}}_ARM64.zip
- name: Update x86 release asset
id: upload-release-asset-x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x86.zip
asset_name: Bili.Uwp_${{github.event.inputs.version}}_x86.zip
asset_content_type: application/zip
- name: Update x64 release asset
id: upload-release-asset-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\Bili.Uwp_${{github.event.inputs.version}}_x64.zip
asset_name: Bili.Uwp_${{github.event.inputs.version}}_x64.zip
asset_content_type: application/zip
- name: Update ARM64 release asset
id: upload-release-asset-ARM64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
asset_path: C:\Package\Bili.Uwp_${{github.event.inputs.version}}_ARM64.zip
asset_name: Bili.Uwp_${{github.event.inputs.version}}_ARM64.zip
asset_content_type: application/zip