Skip to content

Commit

Permalink
housekeeping: Moving package signing into Cake script (#1886)
Browse files Browse the repository at this point in the history
- Fixed packagesArtifactFirectory
- Explicitly typed nupkg to FilePath
- Removed SignPackages.ps1
  • Loading branch information
RLittlesII committed Jan 4, 2019
1 parent bfb9157 commit b60bc3e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
24 changes: 0 additions & 24 deletions SignPackages.ps1

This file was deleted.

39 changes: 37 additions & 2 deletions build.cake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
#addin "nuget:?package=Cake.Powershell&version=0.4.7" #addin "nuget:?package=Cake.Powershell&version=0.4.7"
#addin "nuget:?package=Cake.Codecov&version=0.5.0" #addin "nuget:?package=Cake.Codecov&version=0.5.0"


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

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

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


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

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

////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// ARGUMENTS // ARGUMENTS
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -319,9 +331,32 @@ Task("SignPackages")
.WithCriteria(() => !isPullRequest) .WithCriteria(() => !isPullRequest)
.Does(() => .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") Task("Package")
Expand Down
1 change: 1 addition & 0 deletions build.ps1
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -225,5 +225,6 @@ $cakeArguments += $ScriptArgs


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

0 comments on commit b60bc3e

Please sign in to comment.