Sign-Package.ps1 795 B

1234567891011121314151617181920212223242526
  1. $currentDirectory = split-path $MyInvocation.MyCommand.Definition
  2. # See if we have the ClientSecret available
  3. if([string]::IsNullOrEmpty($Env:SignClientSecret)){
  4. Write-Host "Client Secret not found, not signing packages"
  5. return;
  6. }
  7. dotnet tool install --tool-path . SignClient
  8. # Setup Variables we need to pass into the sign client tool
  9. $appSettings = "$currentDirectory\appsettings.json"
  10. $nupkgs = gci $Env:ArtifactDirectory\*.nupkg -recurse | Select -ExpandProperty FullName
  11. foreach ($nupkg in $nupkgs){
  12. Write-Host "Submitting $nupkg for signing"
  13. .\SignClient 'sign' -c $appSettings -i $nupkg -r $Env:SignClientUser -s $Env:SignClientSecret -n 'Ix.NET' -d 'Ix.NET' -u 'https://github.com/dotnet/reactive'
  14. Write-Host "Finished signing $nupkg"
  15. }
  16. Write-Host "Sign-package complete"