-
Notifications
You must be signed in to change notification settings - Fork 81
532 lines (453 loc) · 23.1 KB
/
build.yml
File metadata and controls
532 lines (453 loc) · 23.1 KB
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# https://docs.github.com/actions/using-workflows/about-workflows
# https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
tags: [ 'release/weekly/**' ]
pull_request:
branches: [ main ]
# Triggers on release publication (including automated weekly releases)
# Note: Tag events don't trigger from GitHub Actions, but release events do
# This allows scheduled-releases.yml to trigger builds via gh release create
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
merge_group:
env:
DOTNET_VERSION: ${{ '9.0.x' }}
ENABLE_DIAGNOSTICS: true
#COREHOST_TRACE: 1
MSBUILD_VERBOSITY: normal
COREHOST_TRACEFILE: corehosttrace.log
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
IS_PR: ${{ startsWith(github.ref, 'refs/pull/') }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "Xaml-Style-Check"
Xaml-Style-Check:
runs-on: windows-2022
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Check XAML Styling
run: powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
# Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
build:
needs: [Xaml-Style-Check]
runs-on: windows-2022
# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
matrix:
winui: [2, 3]
multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
exclude:
# WinUI 2 not supported on wasdk
- winui: 2
multitarget: wasdk
# WinUI 3 not supported on uwp
- winui: 3
multitarget: uwp
env:
MULTI_TARGET_DIRECTORY: tooling/MultiTarget
VERSION_PROPERTY: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/release/')) && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Filter release events to only process weekly releases
# Note: Release events don't support pattern filtering, so we filter manually
# This allows both manual releases and automated weekly releases to trigger builds
- name: Filter release events
if: github.event_name == 'release'
id: filter-release
run: |
$tagName = "${{ github.event.release.tag_name }}"
if ($tagName -match "^release/weekly/") {
Write-Host "Matched weekly release tag: $tagName"
exit 0
} else {
Write-Host "Tag does not match weekly pattern: $tagName - skipping build"
exit 1
}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true
- name: Determine scheduled release commit range
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: range
shell: pwsh
run: |
# Previous weekly tag (2nd newest); fallback to main's HEAD
$prevTag = git tag --list 'release/weekly/*' --sort=-creatordate | Select-Object -Skip 1 -First 1
$tagSha = [string]::IsNullOrWhiteSpace($prevTag) ? (git rev-parse 'origin/main').Trim() : (git rev-list -n 1 $prevTag).Trim()
"PREV_TAG_COMMIT=$tagSha" >> $env:GITHUB_ENV
- name: Get changed components
run: |
$changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ env.PREV_TAG_COMMIT || github.event.before }} ${{ github.sha || github.event.after }})
$buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets ${{ matrix.multitarget }} -WinUIMajorVersion ${{ matrix.winui }})
echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
- name: Configure Pagefile
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Enable User-Mode Dumps collecting
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
shell: powershell
run: |
New-Item '${{ github.workspace }}\CrashDumps' -Type Directory
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpFolder' -Type ExpandString -Value '${{ github.workspace }}\CrashDumps'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: dotnet --info
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: dotnet tool restore
- name: Run Uno Check to Install Dependencies
if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: >
dotnet tool run uno-check
--ci
--fix
--target ${{ matrix.multitarget }}
--non-interactive
--skip wsl
--skip androidemulator
--skip vswinworkloads
--skip vswin
--verbose
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
with:
vs-version: '[17.9,)'
# Generate full solution with all projects (sample gallery heads, components, tests)
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests
working-directory: ./
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -MultiTargets ${{ matrix.multitarget }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }}" -ErrorAction Stop
# Build solution
- name: MSBuild (With diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: >
msbuild.exe /restore /nowarn:MSB4011
/p:Configuration=Release
/m
${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }}
/v:${{ env.MSBUILD_VERBOSITY }}
CommunityToolkit.AllComponents.sln
- name: MSBuild
if: ${{ env.ENABLE_DIAGNOSTICS == 'false' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release
# Run tests
- name: Setup VSTest Path
uses: darenm/setup-vstest@3a16d909a1f3bbc65b52f8270d475d905e7d3e44
- name: Install Testspace Module
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Run component tests against ${{ matrix.multitarget }}
if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
id: test-platform
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
- name: Create test reports
run: |
testspace '[${{ matrix.multitarget }}]./TestResults/*.trx'
if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: build-logs-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: ./**/*.*log
- name: Artifact - ILC Repro
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: ilc-repro
path: ./*.zip
# https://github.com/dorny/paths-filter#custom-processing-of-changed-files
- name: Detect If any Dump Files
uses: dorny/paths-filter@v2.11.1
id: filter
with:
list-files: shell
filters: |
dump:
- added: '${{ github.workspace }}/CrashDumps/*.dmp'
- name: Artifact - WER crash dumps
uses: actions/upload-artifact@v4
if: ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: CrashDumps-${{ matrix.platform }}
path: '${{ github.workspace }}/CrashDumps'
- name: Analyze Dump
if: ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
run: |
dotnet tool install --global dotnet-dump
dotnet-dump analyze ${{ steps.filter.outputs.dump_files }} -c "clrstack" -c "pe -lines" -c "exit"
package:
runs-on: windows-2022
needs: [build]
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
matrix:
winui: [0, 2, 3]
env:
VERSION_PROPERTY: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/release/')) && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true
- name: Format Date/Time for Package Version (Tag builds only)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
$dateString = "${{ github.ref }}" -replace '^refs/tags/release/weekly/', ''
echo "VERSION_DATE=$dateString" >> $env:GITHUB_ENV
- name: Restore dotnet tools
run: dotnet tool restore
- name: Run Uno Check to Install Dependencies
run: >
dotnet tool run uno-check
--ci
--fix
--non-interactive
--skip wsl
--skip androidemulator
--skip vswinworkloads
--skip vswin
--verbose
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.9,)'
- name: Determine scheduled release commit range
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: range
shell: pwsh
run: |
# Previous weekly tag (2nd newest); fallback to main's HEAD
$prevTag = git tag --list 'release/weekly/*' --sort=-creatordate | Select-Object -Skip 1 -First 1
$tagSha = [string]::IsNullOrWhiteSpace($prevTag) ? (git rev-parse 'origin/main').Trim() : (git rev-list -n 1 $prevTag).Trim()
"PREV_TAG_COMMIT=$tagSha" >> $env:GITHUB_ENV
- name: Get changed components
run: |
$changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ env.PREV_TAG_COMMIT || github.event.before }} ${{ github.event.after || github.sha }})
$buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets "all" -WinUIMajorVersion ${{ matrix.winui }})
echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
# Build and pack component nupkg
- name: Build and pack component packages
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: ./tooling/Build-Toolkit-Components.ps1 -MultiTargets all -Components ${{ env.CHANGED_COMPONENTS_LIST }} -WinUIMajorVersion ${{ matrix.winui }} ${{ env.VERSION_DATE != '' && format('-DateForVersion {0}', 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
- name: Validate package names
if: ${{ env.VERSION_PROPERTY != '' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: powershell -version 5.1 -command "Get-ChildItem -Path '*.nupkg' | ForEach-Object { if (`$_.Name -notmatch '${{ env.VERSION_PROPERTY }}') { throw 'Nupkg name is missing trailing VERSION_PROPERTY' + `$_.Name } }" -ErrorAction Stop
# Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
- name: Push Pull Request Packages (if not fork)
if: ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: |
dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json `
--name PullRequests `
--username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
dotnet nuget push "*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
- name: Push packages (main)
if: ${{ github.ref == 'refs/heads/main' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
run: |
dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json `
--name LabsFeed `
--username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
- name: Upload Package List
uses: actions/upload-artifact@v4
if: ${{ (env.IS_PR == 'false' || github.event.pull_request.head.repo.full_name != github.repository) && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
with:
name: nuget-list-${{ matrix.winui }}
if-no-files-found: error
path: |
${{ github.workspace }}/.github/workflows/SignClientFileList.txt
# if we're not doing a PR build (or it's a PR from a fork) then we upload our packages so we can sign as a separate job or have available to test.
- name: Upload Packages as Artifacts
uses: actions/upload-artifact@v4
if: ${{ (env.IS_PR == 'false' || github.event.pull_request.head.repo.full_name != github.repository) && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
with:
name: nuget-packages-winui${{ matrix.winui }}
if-no-files-found: error
path: |
./*.nupkg
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: build-logs-winui${{ matrix.winui }}
path: ./*.*log
sign:
needs: [package]
if: ${{ startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/') }}
runs-on: windows-2022
permissions:
id-token: write # Required for requesting the JWT
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
matrix:
winui: [0, 2, 3]
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Download Package List
uses: actions/download-artifact@v4
with:
name: nuget-list-${{ matrix.winui }}
path: ./
- name: Download built packages for WinUI ${{ matrix.winui }}
uses: actions/download-artifact@v4
with:
name: nuget-packages-winui${{ matrix.winui }}
path: ./packages
- name: Install Signing Tool
run: dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
- name: Sign Packages
run: >
./tools/sign code azure-key-vault
**/*.nupkg
--base-directory "${{ github.workspace }}/packages"
--file-list "${{ github.workspace }}/SignClientFileList.txt"
--timestamp-url "http://timestamp.digicert.com"
--publisher-name ".NET Foundation"
--description "Windows Community Toolkit Labs"
--description-url "https://github.com/CommunityToolkit/Labs-Windows"
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
--azure-key-vault-client-id ${{ secrets.SIGN_CLIENT_ID }}
--azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}"
--azure-key-vault-tenant-id ${{ secrets.SIGN_TENANT_ID }}
--azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}"
--verbosity Information
- name: Push Signed Packages
run: |
dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json `
--name MainLatest `
--username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
dotnet nuget push "**/*.nupkg" --api-key dummy --source MainLatest --skip-duplicate
- name: Upload Signed Packages as Artifacts (for release)
uses: actions/upload-artifact@v4
if: ${{ startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/') }}
with:
name: signed-nuget-packages-${{ matrix.winui }}
if-no-files-found: error
path: |
${{ github.workspace }}/packages/**/*.nupkg
release:
if: ${{ startsWith(github.ref, 'refs/heads/rel/') || startsWith(github.ref, 'refs/tags/') }}
needs: [sign]
environment: nuget-release-gate # This gates this job until manually approved
runs-on: ubuntu-latest
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
matrix:
winui: [0, 2, 3]
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Download signed packages for WinUI ${{ matrix.winui }}
uses: actions/download-artifact@v4
with:
name: signed-nuget-packages-${{ matrix.winui }}
path: ./packages
- name: Push to NuGet.org
run: >
dotnet nuget push
**/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }}
--skip-duplicate
wasm-linux:
runs-on: ubuntu-latest
env:
HEADS_DIRECTORY: tooling/ProjectHeads
steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: .NET Info (if diagnostics)
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
run: dotnet --info
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.sha }}
fetch-depth: 0
fetch-tags: true
# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./tooling/GenerateAllSolution.ps1${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}
- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build
# Issue with Comment Links currently, see: https://github.com/mrlacey/CommentLinks/issues/38
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.App.Wasm.csproj
- name: dotnet build
working-directory: ./${{ env.HEADS_DIRECTORY }}/AllComponents/Wasm/
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
# TODO: Do we want to run tests here? Can we do that on linux easily?
- name: Artifact - Diagnostic Logs
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: linux-logs
path: ./**/*.*log