@@ -8,14 +8,20 @@ name: CI
8
8
on :
9
9
# Triggers the workflow on push or pull request events but only for the main branch
10
10
push :
11
- branches : [ main ]
11
+ branches : [ main, 'rel/weekly' ]
12
12
pull_request :
13
13
branches : [ main ]
14
14
15
15
# Allows you to run this workflow manually from the Actions tab
16
16
workflow_dispatch :
17
17
merge_group :
18
18
19
+ # Allow this workflow to be triggered by scheduled release workflows
20
+ workflow_run :
21
+ workflows : [ weekly-merge ]
22
+ types :
23
+ - completed
24
+
19
25
env :
20
26
DOTNET_VERSION : ${{ '9.0.x' }}
21
27
ENABLE_DIAGNOSTICS : true
72
78
73
79
env :
74
80
MULTI_TARGET_DIRECTORY : tooling/MultiTarget
75
- VERSION_PROPERTY : ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
81
+ VERSION_PROPERTY : ${{ ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/')) && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
76
82
77
83
# Steps represent a sequence of tasks that will be executed as part of the job
78
84
steps :
@@ -228,7 +234,7 @@ jobs:
228
234
winui : [0, 2, 3]
229
235
230
236
env :
231
- VERSION_PROPERTY : ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
237
+ VERSION_PROPERTY : ${{ ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/')) && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
232
238
233
239
steps :
234
240
- name : Install .NET SDK v${{ env.DOTNET_VERSION }}
@@ -320,6 +326,103 @@ jobs:
320
326
name : build-logs-winui${{ matrix.winui }}
321
327
path : ./*.*log
322
328
329
+ sign :
330
+ needs : [package]
331
+ if : ${{ startsWith(github.ref, 'refs/heads/rel/') }}
332
+ runs-on : windows-latest
333
+ permissions :
334
+ id-token : write # Required for requesting the JWT
335
+
336
+ strategy :
337
+ fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
338
+ matrix :
339
+ winui : [2, 3]
340
+
341
+ steps :
342
+ - name : Install .NET SDK v${{ env.DOTNET_VERSION }}
343
+ uses : actions/setup-dotnet@v4
344
+ with :
345
+ dotnet-version : ${{ env.DOTNET_VERSION }}
346
+
347
+ - name : Download Package List
348
+ uses : actions/download-artifact@v4
349
+ with :
350
+ name : nuget-list-${{ matrix.winui }}
351
+ path : ./
352
+
353
+ - name : Download built packages for WinUI ${{ matrix.winui }}
354
+ uses : actions/download-artifact@v4
355
+ with :
356
+ name : nuget-packages-winui${{ matrix.winui }}
357
+ path : ./packages
358
+
359
+ - name : Install Signing Tool
360
+ run : dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
361
+
362
+ - name : Sign Packages
363
+ run : >
364
+ ./tools/sign code azure-key-vault
365
+ **/*.nupkg
366
+ --base-directory "${{ github.workspace }}/packages"
367
+ --file-list "${{ github.workspace }}/SignClientFileList.txt"
368
+ --timestamp-url "http://timestamp.digicert.com"
369
+ --publisher-name ".NET Foundation"
370
+ --description "Windows Community Toolkit Labs"
371
+ --description-url "https://github.com/CommunityToolkit/Labs-Windows"
372
+ --azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
373
+ --azure-key-vault-client-id ${{ secrets.SIGN_CLIENT_ID }}
374
+ --azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}"
375
+ --azure-key-vault-tenant-id ${{ secrets.SIGN_TENANT_ID }}
376
+ --azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}"
377
+ --verbosity Information
378
+
379
+ - name : Push Signed Packages
380
+ run : |
381
+ dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json `
382
+ --name MainLatest `
383
+ --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
384
+ dotnet nuget push "**/*.nupkg" --api-key dummy --source MainLatest --skip-duplicate
385
+
386
+ - name : Upload Signed Packages as Artifacts (for release)
387
+ uses : actions/upload-artifact@v4
388
+ if : ${{ env.IS_RELEASE == 'true' }}
389
+ with :
390
+ name : signed-nuget-packages-${{ matrix.winui }}
391
+ if-no-files-found : error
392
+ path : |
393
+ ${{ github.workspace }}/packages/**/*.nupkg
394
+
395
+ release :
396
+ if : ${{ startsWith(github.ref, 'refs/heads/rel/') }}
397
+ needs : [sign]
398
+ environment : nuget-release-gate # This gates this job until manually approved
399
+ runs-on : ubuntu-latest
400
+
401
+ strategy :
402
+ fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
403
+ matrix :
404
+ winui : [2, 3]
405
+
406
+ steps :
407
+ - name : Install .NET SDK v${{ env.DOTNET_VERSION }}
408
+ uses : actions/setup-dotnet@v4
409
+ with :
410
+ dotnet-version : ${{ env.DOTNET_VERSION }}
411
+
412
+ - name : Download signed packages for WinUI ${{ matrix.winui }}
413
+ uses : actions/download-artifact@v4
414
+ with :
415
+ name : signed-nuget-packages-${{ matrix.winui }}
416
+ path : ./packages
417
+
418
+ - name : Push to NuGet.org
419
+ run : >
420
+ dotnet nuget push
421
+ **/*.nupkg
422
+ --source https://api.nuget.org/v3/index.json
423
+ --api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }}
424
+ --skip-duplicate
425
+
323
426
wasm-linux :
324
427
runs-on : ubuntu-latest
325
428
env :
0 commit comments