-
-
Notifications
You must be signed in to change notification settings - Fork 42
153 lines (132 loc) · 4.04 KB
/
main.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
name: Windows Release Builder
on:
push:
branches:
- main
tags:
- v**
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
xaml-lint:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.x'
- name: Restore dotnet tools
run: dotnet tool restore
- name: Lint XAML files
run: .\scripts\lint-xaml.ps1
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- uses: actions/cache@v4
with:
path: ~\.nuget\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Fetch Gomplate
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: hairyhenderson/gomplate
version: tags/v3.11.3
file: gomplate_windows-amd64-slim.exe
target: gomplate.exe
token: ${{ secrets.GITHUB_TOKEN }}
- name: Render secrets
env:
APPCENTER_API_KEY: ${{ secrets.APPCENTER_API_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: Get-Content Screenbox/Secrets.cs.template | .\gomplate.exe | Set-Content Screenbox/Secrets.cs
- name: Get tag version
id: get-tag-version
if: github.ref_type == 'tag'
run: |
$found = "${{ github.ref_name }}" -match 'v*(\d+.\d+.\d+)'
if ($found) { $match = $matches[1] }
"version=$match" >> $env:GITHUB_OUTPUT
- name: Update package manifest
run: .\scripts\update-manifest.ps1 -Version "${{ steps.get-tag-version.outputs.version }}"
- name: Build store package
run: |
msbuild Screenbox.sln `
-v:d `
-p:RestoreConfigFile=nuget.config `
-p:RestoreLockedMode=true `
-p:Configuration=Release `
-p:Platform=x64 `
-p:AppxBundle=Always `
-p:AppxBundlePlatforms="$env:BuildPlatforms" `
-p:UapAppxPackageBuildMode=$env:BuildMode `
-p:AppxPackageDir=$env:PackageDir `
-p:AppxPackageSigningEnabled=false `
-restore
env:
BuildMode: StoreUpload
BuildPlatforms: x86|x64|arm64
PackageDir: C:\DeployOutput
- name: Create store-upload artifact
uses: actions/upload-artifact@v4
if: github.ref_type == 'tag'
with:
name: store-upload
path: |
C:\DeployOutput\*.msixupload
C:\DeployOutput\*.appxupload
- name: Create sideload artifact
uses: actions/upload-artifact@v4
with:
name: Screenbox-sideload
path: |
C:\DeployOutput\*_Test
wack:
needs: build
runs-on: windows-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Screenbox-sideload
path: C:\Download\
- name: Rename test folder
run: Get-ChildItem -Directory -Path C:\Download\Screenbox_*_Test | Rename-Item -NewName Screenbox
- name: Rename test package
run: Get-ChildItem -Path C:\Download\Screenbox\*.msixbundle | Rename-Item -NewName Screenbox.msixbundle
- uses: huynhsontung/wack-certification@main
with:
name: 'WACK'
package-path: 'C:\Download\Screenbox\Screenbox.msixbundle'
report-name: 'Screenbox.Certification.xml'
ignore-rules: '38'
release:
needs: build
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download package
uses: actions/download-artifact@v4
with:
name: Screenbox-sideload
path: download/
- name: Zip artifact
run: zip -r sideload.zip download/
- name: Generate GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
files: |
sideload.zip