Skip to content

Commit

Permalink
housekeeping: Moving package signing into Cake script
Browse files Browse the repository at this point in the history
- Fixed packagesArtifactFirectory
- Explicitly typed nupkg to FilePath
  • Loading branch information
RLittlesII committed Jan 4, 2019
1 parent 8dc8fa8 commit d8dd522
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
34 changes: 32 additions & 2 deletions build.cake
Expand Up @@ -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
//////////////////////////////////////////////////////////////////////
Expand All @@ -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
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -319,9 +331,27 @@ Task("SignPackages")
.WithCriteria(() => !isPullRequest)
.Does(() =>
{
StartPowershellFile("./SignPackages.ps1", args =>
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")
Expand Down
1 change: 1 addition & 0 deletions build.ps1
Expand Up @@ -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 d8dd522

Please sign in to comment.