Skip to content

Commit

Permalink
Enable Package Signing - fixes PrismLibrary#1470
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jun 13, 2018
1 parent c3bf4b4 commit 865d738
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,6 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/

# DotNet Tools
**/build/.store/*
26 changes: 26 additions & 0 deletions Source/build/Sign-Packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$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\appsettings.json"
$fileList = "$currentDirectory\filelist.txt"

$nupkgs = gci $Env:ArtifactDirectory\*.nupkg -recurse | Select-Object -ExpandProperty FullName

foreach ($nupkg in $nupkgs){
Write-Host "Submitting $nupkg for signing"

.\SignClient 'sign' -c $appSettings -i $nupkg -f $fileList -r $Env:SignClientUser -s $Env:SignClientSecret -n 'Prism' -d 'Prism' -u 'https://github.com/PrismLibrary/Prism'

Write-Host "Finished signing $nupkg"
}

Write-Host "Sign-package complete"
13 changes: 13 additions & 0 deletions Source/build/appsettings.json
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"
}
}
}
1 change: 1 addition & 0 deletions Source/build/filelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**\Prism.*

0 comments on commit 865d738

Please sign in to comment.