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