Skip to content

Commit a9e867f

Browse files
committed
Updated to azure pipelines.
1 parent 8d2b183 commit a9e867f

File tree

4 files changed

+97
-23
lines changed

4 files changed

+97
-23
lines changed

appveyor.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
trigger:
2+
- master
3+
- rel/*
4+
5+
pr:
6+
- master
7+
- rel/*
8+
9+
pool:
10+
vmImage: windows-2019
11+
12+
variables:
13+
BuildConfiguration: Release
14+
15+
steps:
16+
- task: BatchScript@1
17+
inputs:
18+
filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
19+
arguments: -no_logo
20+
modifyEnvironment: true
21+
displayName: Setup Environment Variables
22+
23+
- task: NuGetToolInstaller@1
24+
displayName: Use NuGet 5.5.1
25+
inputs:
26+
versionSpec: 5.5.1
27+
28+
- task: DotNetCoreCLI@2
29+
inputs:
30+
command: custom
31+
custom: tool
32+
arguments: install --tool-path . nbgv
33+
displayName: Install NBGV tool
34+
35+
- script: nbgv cloud
36+
displayName: Set Version
37+
38+
- powershell: .\build\build.ps1
39+
displayName: Build
40+
41+
- task: PowerShell@2
42+
displayName: Authenticode Sign Packages
43+
inputs:
44+
filePath: build/Sign-Package.ps1
45+
env:
46+
SignClientUser: $(SignClientUser)
47+
SignClientSecret: $(SignClientSecret)
48+
ArtifactDirectory: build\nupkg
49+
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
50+
51+
- task: PublishBuildArtifacts@1
52+
displayName: Publish Package Artifacts
53+
inputs:
54+
pathToPublish: .\build\nupkg
55+
artifactType: container
56+
artifactName: Packages

build/Sign-Package.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
$currentDirectory = split-path $MyInvocation.MyCommand.Definition
3+
4+
# See if we have the ClientSecret available
5+
if([string]::IsNullOrEmpty($Env:SignClientSecret)){
6+
Write-Host "Client Secret not found, not signing packages"
7+
return;
8+
}
9+
10+
dotnet tool install --tool-path . SignClient
11+
12+
# Setup Variables we need to pass into the sign client tool
13+
14+
$appSettings = "$currentDirectory\SignClientSettings.json"
15+
16+
$nupkgs = gci $Env:ArtifactDirectory\*.nupkg -recurse | Select -ExpandProperty FullName
17+
18+
foreach ($nupkg in $nupkgs){
19+
Write-Host "Submitting $nupkg for signing"
20+
21+
.\SignClient 'sign' -c $appSettings -i $nupkg -r $Env:SignClientUser -s $Env:SignClientSecret -n 'Windows Community Toolkit' -d 'Windows Community Toolkit' -u 'https://developer.microsoft.com/en-us/windows/uwp-community-toolkit'
22+
if ($LASTEXITCODE -ne 0) {
23+
exit 1
24+
}
25+
Write-Host "Finished signing $nupkg"
26+
}
27+
28+
Write-Host "Sign-package complete"

build/SignClientSettings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"SignClient": {
3+
"AzureAd": {
4+
"AADInstance": "https://login.microsoftonline.com/",
5+
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
6+
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
7+
},
8+
"Service": {
9+
"Url": "https://codesign.dotnetfoundation.org/",
10+
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)