@@ -66,14 +66,13 @@ jobs:
66
66
winui : [2, 3]
67
67
multitarget : ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
68
68
exclude :
69
+ # WinUI 2 not supported on wasdk
69
70
- winui : 2
70
71
multitarget : wasdk
72
+ # WinUI 3 not supported on uwp
71
73
- winui : 3
72
74
multitarget : uwp
73
75
74
- env :
75
- VERSION_PROPERTY : ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
76
-
77
76
# Steps represent a sequence of tasks that will be executed as part of the job
78
77
steps :
79
78
- name : Configure Pagefile
@@ -129,57 +128,21 @@ jobs:
129
128
with :
130
129
vs-version : ' [17.9,)'
131
130
132
- - name : Enable ${{ matrix.multitarget }} TargetFrameworks
133
- working-directory : ./${{ env.MULTI_TARGET_DIRECTORY }}
134
- run : powershell -version 5.1 -command "./UseTargetFrameworks.ps1 -Include ${{ matrix.multitarget }}" -ErrorAction Stop
135
-
136
- - name : Set WinUI Version
137
- working-directory : ./${{ env.MULTI_TARGET_DIRECTORY }}
138
- run : powershell -version 5.1 -command "./UseUnoWinUI.ps1 ${{ matrix.winui }}" -ErrorAction Stop
139
-
140
- - name : Generate solution with ${{ matrix.multitarget }} gallery and tests
131
+ # Generate full solution with all projects (sample gallery heads, components, tests)
132
+ - name : Generate solution with ${{ matrix.multitarget }} gallery, components and tests
141
133
working-directory : ./
142
- run : powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ matrix.multitarget }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
143
-
144
- - name : Format Date/Time of Commit for Package Version
145
- if : ${{ env.IS_RELEASE == 'false' }}
146
- run : |
147
- echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV
148
-
149
- # Semver regex: https://regex101.com/r/Ly7O1x/3/
150
- - name : Format Date/Time of Release Package Version
151
- if : ${{ env.IS_RELEASE == 'true' }}
152
- run : |
153
- $ref = "${{ github.ref }}"
154
- $ref -match "^refs/heads/rel/(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
155
- echo "VERSION_DATE=$($matches['patch'])" >> $env:GITHUB_ENV
156
- echo "VERSION_PROPERTY=$($matches['prerelease'])" >> $env:GITHUB_ENV
134
+ run : powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop
157
135
136
+ # Build solution
158
137
- name : MSBuild
159
138
run : >
160
139
msbuild.exe /restore /nowarn:MSB4011
161
140
/p:Configuration=Release
162
141
/m
163
- /p:DateForVersion=${{ env.VERSION_DATE }}
164
- /p:PreviewVersion=${{ env.VERSION_PROPERTY }}
165
142
${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }}
166
143
/v:${{ env.MSBUILD_VERBOSITY }}
167
144
CommunityToolkit.AllComponents.sln
168
145
169
- # Build All Packages
170
- - name : pack experiments
171
- working-directory : ./tooling/Scripts/
172
- run : ./PackEachExperiment.ps1 -date ${{ env.VERSION_DATE }}${{ env.VERSION_PROPERTY != '' && format(' -postfix {0}', env.VERSION_PROPERTY) || '' }}
173
-
174
- # Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
175
- - name : Push Pull Request Packages (if not fork)
176
- if : ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
177
- run : |
178
- dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json `
179
- --name PullRequests `
180
- --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
181
- dotnet nuget push "**/*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
182
-
183
146
# Run tests
184
147
- name : Setup VSTest Path
185
148
uses : darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
@@ -193,21 +156,22 @@ jobs:
193
156
id : test-generator
194
157
run : vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
195
158
196
- - name : Run experiment tests against ${{ matrix.multitarget }}
159
+ - name : Run component tests against ${{ matrix.multitarget }}
197
160
if : ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
198
161
id : test-platform
199
162
run : vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
200
163
201
164
- name : Create test reports
165
+ if : ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
202
166
run : |
203
- testspace '[${{ matrix.platform }}]./TestResults/*.trx'
167
+ testspace '[${{ matrix.multitarget }}]./TestResults/*.trx'
204
168
if : ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}
205
169
206
170
- name : Artifact - Diagnostic Logs
207
171
uses : actions/upload-artifact@v4
208
172
if : ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
209
173
with :
210
- name : build-logs-${{ matrix.platform }}
174
+ name : build-logs-${{ matrix.multitarget }}-winui${{ matrix.winui }}
211
175
path : ./**/*.*log
212
176
213
177
- name : Artifact - ILC Repro
@@ -229,7 +193,7 @@ jobs:
229
193
uses : actions/upload-artifact@v4
230
194
if : ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
231
195
with :
232
- name : CrashDumps-${{ matrix.platform }}
196
+ name : CrashDumps-${{ matrix.multitarget }}-winui${{ matrix.winui }}
233
197
path : ' ${{ github.workspace }}/CrashDumps'
234
198
235
199
- name : Analyze Dump
@@ -238,11 +202,80 @@ jobs:
238
202
dotnet tool install --global dotnet-dump
239
203
dotnet-dump analyze ${{ steps.detect-dump.outputs.DUMP_FILE }} -c "clrstack" -c "pe -lines" -c "exit"
240
204
205
+ package :
206
+ needs : [build]
207
+ strategy :
208
+ fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
209
+ matrix :
210
+ winui : [2, 3]
211
+
212
+ env :
213
+ VERSION_PROPERTY : ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
214
+
215
+ steps :
216
+ - name : Install .NET SDK v${{ env.DOTNET_VERSION }}
217
+ uses : actions/setup-dotnet@v4
218
+ with :
219
+ dotnet-version : ${{ env.DOTNET_VERSION }}
220
+
221
+ - name : .NET Info (if diagnostics)
222
+ if : ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
223
+ run : dotnet --info
224
+
225
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
226
+ - name : Checkout Repository
227
+ uses : actions/checkout@v4
228
+ with :
229
+ submodules : recursive
230
+
231
+ # Semver regex: https://regex101.com/r/Ly7O1x/3/
232
+ - name : Format Date/Time of Release Package Version
233
+ if : ${{ env.IS_RELEASE == 'true' }}
234
+ run : |
235
+ $ref = "${{ github.ref }}"
236
+ $ref -match "^refs/heads/rel/(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
237
+ echo "VERSION_DATE=$($matches['patch'])" >> $env:GITHUB_ENV
238
+ echo "VERSION_PROPERTY=$($matches['prerelease'])" >> $env:GITHUB_ENV
239
+
240
+ - name : Format Date/Time of Commit for Package Version
241
+ if : ${{ env.IS_RELEASE == 'false' }}
242
+ run : |
243
+ echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV
244
+
245
+ - name : Run Uno Check to Install Dependencies
246
+ run : >
247
+ dotnet tool run uno-check
248
+ --ci
249
+ --fix
250
+ --non-interactive
251
+ --skip wsl
252
+ --skip androidemulator
253
+ --skip vswinworkloads
254
+ --verbose
255
+
256
+ - name : Add msbuild to PATH
257
+ uses : microsoft/setup-msbuild@v2
258
+ with :
259
+ vs-version : ' [17.9,)'
260
+
261
+ # Build and pack component nupkg
262
+ - name : Build and pack component packages
263
+ run : ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -WinUIMajorVersion ${{ matrix.winui }} -DateForVersion ${{ env.VERSION_DATE }} ${{ env.VERSION_PROPERTY != '' && format(' -PreviewVersion {0}', env.VERSION_PROPERTY) || '' }} -EnableBinlogs ${{ env.ENABLE_DIAGNOSTICS }} -Verbose ${{ env.ENABLE_DIAGNOSTICS }} -BinlogOutput ./ -NupkgOutput ./ -Release
264
+
265
+ # Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
266
+ - name : Push Pull Request Packages (if not fork)
267
+ if : ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
268
+ run : |
269
+ dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json `
270
+ --name PullRequests `
271
+ --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
272
+ dotnet nuget push "./*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
273
+
241
274
- name : Upload Package List
242
275
uses : actions/upload-artifact@v4
243
276
if : ${{ env.IS_PR == 'false' }}
244
277
with :
245
- name : nuget-list-${{ matrix.platform }}
278
+ name : nuget-list-${{ matrix.winui }}
246
279
if-no-files-found : error
247
280
path : |
248
281
${{ github.workspace }}/.github/workflows/SignClientFileList.txt
@@ -252,13 +285,20 @@ jobs:
252
285
uses : actions/upload-artifact@v4
253
286
if : ${{ env.IS_PR == 'false' || github.event.pull_request.head.repo.full_name != github.repository }}
254
287
with :
255
- name : nuget-packages-${{ matrix.platform }}
288
+ name : nuget-packages-winui ${{ matrix.winui }}
256
289
if-no-files-found : error
257
290
path : |
258
- **/*.nupkg
291
+ ./*.nupkg
292
+
293
+ - name : Artifact - Diagnostic Logs
294
+ uses : actions/upload-artifact@v4
295
+ if : ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
296
+ with :
297
+ name : build-logs-winui${{ matrix.winui }}
298
+ path : ./*.*log
259
299
260
300
sign :
261
- needs : [build ]
301
+ needs : [package ]
262
302
if : ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') }}
263
303
runs-on : windows-latest
264
304
permissions :
@@ -267,7 +307,7 @@ jobs:
267
307
strategy :
268
308
fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
269
309
matrix :
270
- platform : [WinUI2, WinUI3 ]
310
+ winui : [2, 3 ]
271
311
272
312
steps :
273
313
- name : Install .NET SDK v${{ env.DOTNET_VERSION }}
@@ -278,13 +318,13 @@ jobs:
278
318
- name : Download Package List
279
319
uses : actions/download-artifact@v4
280
320
with :
281
- name : nuget-list-${{ matrix.platform }}
321
+ name : nuget-list-${{ matrix.winui }}
282
322
path : ./
283
323
284
- - name : Download built packages for ${{ matrix.platform }}
324
+ - name : Download built packages for WinUI ${{ matrix.winui }}
285
325
uses : actions/download-artifact@v4
286
326
with :
287
- name : nuget-packages-${{ matrix.platform }}
327
+ name : nuget-packages-winui ${{ matrix.winui }}
288
328
path : ./packages
289
329
290
330
- name : Install Signing Tool
0 commit comments