Permalink
Browse files

housekeeping: Moving package signing into Cake script (#1886)

- Fixed packagesArtifactFirectory
- Explicitly typed nupkg to FilePath
- Removed SignPackages.ps1
  • Loading branch information...
RLittlesII committed Jan 4, 2019
1 parent 8dc8fa8 commit f9a9308307169a47a13fba010e50fabed0215132
Showing with 38 additions and 26 deletions.
  1. +0 −24 SignPackages.ps1
  2. +37 −2 build.cake
  3. +1 −0 build.ps1

This file was deleted.

Oops, something went wrong.
@@ -12,6 +12,12 @@
#addin "nuget:?package=Cake.Powershell&version=0.4.7"
#addin "nuget:?package=Cake.Codecov&version=0.5.0"

//////////////////////////////////////////////////////////////////////
// MODULES
//////////////////////////////////////////////////////////////////////

#module nuget:?package=Cake.DotNetTool.Module&version=0.1.0

//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////
@@ -23,6 +29,12 @@
#tool "nuget:?package=xunit.runner.console&version=2.4.1"
#tool "nuget:?package=Codecov&version=1.1.0"

//////////////////////////////////////////////////////////////////////
// DOTNET TOOLS
//////////////////////////////////////////////////////////////////////

#tool "dotnet:?package=SignClient&version=1.0.82"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
@@ -319,9 +331,32 @@ Task("SignPackages")
.WithCriteria(() => !isPullRequest)
.Does(() =>
{
StartPowershellFile("./SignPackages.ps1", args =>
if(EnvironmentVariable("SIGNCLIENT_SECRET") == null)
{
throw new Exception("Client Secret not found, not signing packages.");
}

var nupkgs = GetFiles(packagesArtifactDirectory + "/*.nupkg");
foreach(FilePath nupkg in nupkgs)
{
});
var packageName = nupkg.GetFilenameWithoutExtension();
Information($"Submitting {packageName} for signing");

DotNetCoreTool("SignClient", new DotNetCoreToolSettings{
ArgumentCustomization = args =>
args.AppendSwitch("-c", "./SignPackages.json")
.AppendSwitch("-i", nupkg.FullPath)
.AppendSwitch("-r", EnvironmentVariable("SIGNCLIENT_USER"))
.AppendSwitch("-s", EnvironmentVariable("SIGNCLIENT_SECRET"))
.AppendSwitch("-n", "ReactiveUI")
.AppendSwitch("-d", "ReactiveUI")
.AppendSwitch("-u", "https://reactiveui.net")
});

Information($"Finished signing {packageName}");
}

Information("Sign-package complete");
});

Task("Package")
@@ -225,5 +225,6 @@ $cakeArguments += $ScriptArgs

# Start Cake
Write-Host "Running build script..."
&$CAKE_EXE --bootstrap
&$CAKE_EXE $cakeArguments
exit $LASTEXITCODE

0 comments on commit f9a9308

Please sign in to comment.