-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signing to NuGet package pipeline (#5)
* Update azure-pipelines.yml * Create Sign-Package.ps1 * Create SignClientSettings.json
- Loading branch information
1 parent
759a34b
commit 6f94788
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
$currentDirectory = split-path $MyInvocation.MyCommand.Definition | ||
|
||
# See if we have the ClientSecret available | ||
if ([string]::IsNullOrEmpty($Env:SignClientSecret)) { | ||
Write-Host "Client Secret not found, not signing packages" | ||
return; | ||
} | ||
|
||
dotnet tool install --tool-path . SignClient | ||
|
||
# Setup Variables we need to pass into the sign client tool | ||
|
||
$appSettings = "$currentDirectory\SignClientSettings.json" | ||
|
||
$nupkgs = Get-ChildItem $Env:ArtifactDirectory\*.nupkg -recurse | Select-Object -ExpandProperty FullName | ||
|
||
foreach ($nupkg in $nupkgs) { | ||
Write-Host "Submitting $nupkg for signing" | ||
|
||
.\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' | ||
if ($LASTEXITCODE -ne 0) { | ||
exit 1 | ||
} | ||
Write-Host "Finished signing $nupkg" | ||
} | ||
|
||
Write-Host "Sign-package complete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"SignClient": { | ||
"AzureAd": { | ||
"AADInstance": "https://login.microsoftonline.com/", | ||
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8", | ||
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e" | ||
}, | ||
"Service": { | ||
"Url": "https://codesign.dotnetfoundation.org/", | ||
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001" | ||
} | ||
} | ||
} |