24
24
COREHOST_TRACEFILE : corehosttrace.log
25
25
MULTI_TARGET_DIRECTORY : tooling/MultiTarget
26
26
HEADS_DIRECTORY : tooling/ProjectHeads
27
+ IS_MAIN : ${{ github.ref == 'refs/heads/main' }}
28
+ IS_PR : ${{ startsWith(github.ref, 'refs/pull/') }}
29
+ IS_RELEASE : ${{ startsWith(github.ref, 'refs/heads/rel/') }}
27
30
28
31
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
29
32
jobs :
@@ -120,9 +123,9 @@ jobs:
120
123
run : powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
121
124
122
125
- name : Enable Uno.WinUI (in WinUI3 matrix only)
126
+ if : ${{ matrix.platform == 'WinUI3' }}
123
127
working-directory : ./${{ env.MULTI_TARGET_DIRECTORY }}
124
128
run : powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
125
- if : ${{ matrix.platform == 'WinUI3' }}
126
129
127
130
- name : MSBuild
128
131
run : msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release -m ${{ env.VERSION_PROPERTY }} ${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }} -v:${{ env.MSBUILD_VERBOSITY }}
@@ -132,17 +135,12 @@ jobs:
132
135
working-directory : ./tooling/Scripts/
133
136
run : ./PackEachExperiment.ps1 -extraBuildProperties "${{ env.VERSION_PROPERTY }}"
134
137
135
- # Push Packages to our DevOps Artifacts Feed (see nuget.config)
136
- - name : Add source (main)
137
- if : ${{ github.ref == 'refs/heads/main' }}
138
- run : dotnet nuget update source MainLatest --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
139
-
140
- - name : Add source (pull requests)
141
- if : ${{ github.ref != 'refs/heads/main' }}
142
- 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 }}
143
-
144
- - name : Push packages
145
- run : dotnet nuget push "**/*.nupkg" --api-key dummy --source ${{ github.ref == 'refs/heads/main' && 'MainLatest' || 'PullRequests' }} --skip-duplicate
138
+ # Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
139
+ - name : Push Pull Request Packages
140
+ if : ${{ env.IS_PR }}
141
+ run : |
142
+ 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 }}
143
+ dotnet nuget push "**/*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
146
144
147
145
# Run tests
148
146
- name : Setup VSTest Path
@@ -201,6 +199,69 @@ jobs:
201
199
dotnet tool install --global dotnet-dump
202
200
dotnet-dump analyze ${{ steps.detect-dump.outputs.DUMP_FILE }} -c "clrstack" -c "pe -lines" -c "exit"
203
201
202
+ # if we're not doing a PR build then we upload our packages so we can sign as a separate job.
203
+ - name : Upload Packages as Artifacts
204
+ uses : actions/upload-artifact@v3
205
+ # TODO: if: ${{ env.IS_PR == false }}
206
+ with :
207
+ name : nuget-packages-${{ matrix.platform }}
208
+ if-no-files-found : error
209
+ path : |
210
+ **/*.nupkg
211
+
212
+ sign :
213
+ needs : [build]
214
+ # TODO: if: ${{ env.IS_MAIN }}
215
+ runs-on : windows-latest
216
+
217
+ strategy :
218
+ fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
219
+ matrix :
220
+ platform : [WinUI2, WinUI3]
221
+
222
+ steps :
223
+ - name : Checkout Repository
224
+ uses : actions/checkout@v3
225
+
226
+ - name : Install .NET SDK v${{ env.DOTNET_VERSION }}
227
+ uses : actions/setup-dotnet@v3
228
+ with :
229
+ dotnet-version : ${{ env.DOTNET_VERSION }}
230
+
231
+ - name : Download built packages for ${{ matrix.platform }}
232
+ uses : actions/download-artifact@v3
233
+ with :
234
+ name : nuget-packages-${{ matrix.platform }}
235
+ path : ./packages
236
+
237
+ - name : Install Signing Tool
238
+ run : dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
239
+
240
+ - name : Sign Packages
241
+ run : ./tools/sign code azure-key-vault "**/*.nupkg" \
242
+ --timestamp-url "http://timestamp.digicert.com" \
243
+ --base-directory "${{ github.workspace }}/packages" \
244
+ --file-list "${{ github.workspace }}/.github/workflows/SignClientFileList.txt" \
245
+ --publisher-name ".NET Foundation" \
246
+ --description "Windows Community Toolkit" \
247
+ --description-url "https://github.com/CommunityToolkit/Windows" \
248
+ --azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}" \
249
+ --azure-key-vault-client-id "${{ secrets.SIGN_CLIENT_ID }}" \
250
+ --azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}" \
251
+ --azure-key-vault-tenant-id "${{ secrets.SIGN_TENANT_ID }}" \
252
+ --azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
253
+
254
+ # - name: Add source (main)
255
+ # run: dotnet nuget update source MainLatest --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
256
+
257
+ # TODO: For now push to PR feed so we can validate if any of this works...
258
+ - name : Push Signed Packages
259
+ run : |
260
+ 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 }}
261
+ dotnet nuget push "**/*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
262
+
263
+ # TODO: If release we should push to NuGet
264
+
204
265
wasm-linux :
205
266
runs-on : ubuntu-latest
206
267
0 commit comments