Permalink
Browse files

Add code signing scripts

  • Loading branch information...
1 parent 371c83c commit 2b4bf46aa54eb286004ca2d8e6c058980d3fcaba @onovotny onovotny committed Sep 16, 2016
Showing with 73 additions and 2 deletions.
  1. +27 −1 Ix.NET/Source/build-new.ps1
  2. +27 −1 Rx.NET/Source/build-new.ps1
  3. +2 −0 appveyor.ix.yml
  4. +2 −0 appveyor.rx.yml
  5. +2 −0 appveyor.yml
  6. +13 −0 scripts/SignClientSettings.json
@@ -6,10 +6,14 @@ $nuspecDir = Join-Path $scriptPath "NuSpecs"
$isAppVeyor = Test-Path -Path env:\APPVEYOR
$outputLocation = Join-Path $scriptPath "testResults"
+$signClientSettings = Join-Path (Join-Path (Get-Item $scriptPath).Parent.Parent.FullName "scripts") "SignClientSettings.json"
+$hasSignClientSecret = !([string]::IsNullOrEmpty($env:SignClientSecret))
+$signClientAppPath = Join-Path (Join-Path (Join-Path .\Packages "SignClient") "Tools") "SignClient.dll"
+
#remove any old coverage file
md -Force $outputLocation | Out-Null
$outputPath = (Resolve-Path $outputLocation).Path
-$outputFile = Join-Path $outputPath -childpath 'coverage.xml'
+$outputFile = Join-Path $outputPath -childpath 'coverage-ix.xml'
Remove-Item $outputPath -Force -Recurse
md -Force $outputLocation | Out-Null
@@ -24,6 +28,7 @@ $msbuildExe = Join-Path $msbuild.MSBuildToolsPath "msbuild.exe"
# get tools
.\nuget.exe install -excludeversion gitversion.commandline -outputdirectory packages
+.\nuget.exe install -excludeversion SignClient -Version 0.5.0-beta3 -pre -outputdirectory packages
.\nuget.exe install -excludeversion OpenCover -outputdirectory packages
.\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
@@ -74,7 +79,28 @@ foreach ($nuspec in $nuspecs) {
$host.SetShouldExit($LastExitCode)
}
}
+}
+
+if($hasSignClientSecret) {
+ Write-Host "Signing Packages" -Foreground Green
+ $nupgks = ls .\artifacts\*.nupkg | Select -ExpandProperty FullName
+
+ foreach ($nupkg in $nupgks) {
+ Write-Host "Submitting $nupkg for signing"
+
+ dotnet $signClientAppPath 'zip' -c $signClientSettings -i $nupkg -s $env:SignClientSecret -n 'Ix.NET' -d 'Interactive Extensions for .NET' -u 'http://reactivex.io/'
+
+ if ($LastExitCode -ne 0) {
+ Write-Host "Error signing $nupkg" -Foreground Red
+ if($isAppVeyor) {
+ $host.SetShouldExit($LastExitCode)
+ }
+ }
+ Write-Host "Finished signing $nupkg"
+ }
+} else {
+ Write-Host "Client Secret not found, not signing packages"
}
Write-Host "Running tests" -Foreground Green
@@ -7,10 +7,14 @@ $isAppVeyor = Test-Path -Path env:\APPVEYOR
$outputLocation = Join-Path $scriptPath "testResults"
$openCoverPath = ".\packages\OpenCover\tools\OpenCover.Console.exe"
+$signClientSettings = Join-Path (Join-Path (Get-Item $scriptPath).Parent.Parent.FullName "scripts") "SignClientSettings.json"
+$hasSignClientSecret = !([string]::IsNullOrEmpty($env:SignClientSecret))
+$signClientAppPath = Join-Path (Join-Path (Join-Path .\Packages "SignClient") "Tools") "SignClient.dll"
+
#remove any old coverage file
md -Force $outputLocation | Out-Null
$outputPath = (Resolve-Path $outputLocation).Path
-$outputFile = Join-Path $outputPath -childpath 'coverage.xml'
+$outputFile = Join-Path $outputPath -childpath 'coverage-rx.xml'
Remove-Item $outputPath -Force -Recurse
md -Force $outputLocation | Out-Null
@@ -24,6 +28,7 @@ $msbuildExe = Join-Path $msbuild.MSBuildToolsPath "msbuild.exe"
# get version
.\nuget.exe install -excludeversion gitversion.commandline -outputdirectory packages
+.\nuget.exe install -excludeversion SignClient -Version 0.5.0-beta3 -pre -outputdirectory packages
.\nuget.exe install -excludeversion OpenCover -outputdirectory packages
.\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
@@ -90,7 +95,28 @@ foreach ($nuspec in $nuspecs)
$host.SetShouldExit($LastExitCode)
}
}
+}
+
+if($hasSignClientSecret) {
+ Write-Host "Signing Packages" -Foreground Green
+ $nupgks = ls .\artifacts\*.nupkg | Select -ExpandProperty FullName
+
+ foreach ($nupkg in $nupgks) {
+ Write-Host "Submitting $nupkg for signing"
+
+ dotnet $signClientAppPath 'zip' -c $signClientSettings -i $nupkg -s $env:SignClientSecret -n 'Rx.NET' -d 'Reactive Extensions for .NET' -u 'http://reactivex.io/'
+
+ if ($LastExitCode -ne 0) {
+ Write-Host "Error signing $nupkg" -Foreground Red
+ if($isAppVeyor) {
+ $host.SetShouldExit($LastExitCode)
+ }
+ }
+ Write-Host "Finished signing $nupkg"
+ }
+} else {
+ Write-Host "Client Secret not found, not signing packages"
}
Write-Host "Running tests" -Foreground Green
View
@@ -3,6 +3,8 @@ image: Visual Studio 2015
environment:
COVERALLS_REPO_TOKEN:
secure: DOSlU041NY0WKjv9njrNqj14CLEzrF4ogZsbvqIXnNLd492oNlQf4dD5yr7TSK/S
+ SignClientSecret:
+ secure: oR9TMOkkvP/prmXyMT+p6mQhjyw3JDLbuywezBABvXzkvNsdNZgi2yPaHhgaofrb
skip_branch_with_pr: true
View
@@ -3,6 +3,8 @@ image: Visual Studio 2015
environment:
COVERALLS_REPO_TOKEN:
secure: DOSlU041NY0WKjv9njrNqj14CLEzrF4ogZsbvqIXnNLd492oNlQf4dD5yr7TSK/S
+ SignClientSecret:
+ secure: oR9TMOkkvP/prmXyMT+p6mQhjyw3JDLbuywezBABvXzkvNsdNZgi2yPaHhgaofrb
skip_branch_with_pr: true
View
@@ -3,6 +3,8 @@ image: Visual Studio 2015
environment:
COVERALLS_REPO_TOKEN:
secure: DOSlU041NY0WKjv9njrNqj14CLEzrF4ogZsbvqIXnNLd492oNlQf4dD5yr7TSK/S
+ SignClientSecret:
+ secure: oR9TMOkkvP/prmXyMT+p6mQhjyw3JDLbuywezBABvXzkvNsdNZgi2yPaHhgaofrb
skip_branch_with_pr: true
@@ -0,0 +1,13 @@
+{
+ "SignClient": {
+ "AzureAd": {
+ "AADInstance": "https://login.microsoftonline.com/",
+ "ClientId": "7ac43fb3-01d7-4bc9-9372-d8064cadeb44",
+ "TenantId": "dotnetfoundation.onmicrosoft.com"
+ },
+ "Service": {
+ "Url": "https://dnfsignservice.azurewebsites.net/",
+ "ResourceId": "http://sign.dotnetfoundation.org/server"
+ }
+ }
+}

0 comments on commit 2b4bf46

Please sign in to comment.