Sign-Package.ps1 842 B

123456789101112131415161718192021222324252627282930
  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. if ($LASTEXITCODE -ne 0) {
  15. exit 1
  16. }
  17. Write-Host "Finished signing $nupkg"
  18. }
  19. Write-Host "Sign-package complete"