Permalink
Browse files

housekeeping: fix signing to work/use nbgv from cake. (#1895)

  • Loading branch information...
glennawatson committed Jan 7, 2019
1 parent 00eff40 commit 741577c8e0bc3d7e5939dc623707f964e8d5439a
Showing with 17 additions and 21 deletions.
  1. +0 −10 azure-pipelines.yml
  2. +17 −11 build.cake
@@ -19,16 +19,6 @@ steps:
modifyEnvironment: true
displayName: Setup Environment Variables

- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

- script: nbgv cloud
displayName: Set Version

- powershell: .\build.ps1
displayName: Build
env:
@@ -33,6 +33,7 @@
//////////////////////////////////////////////////////////////////////

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

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
@@ -138,6 +139,8 @@ Setup(context =>
CreateDirectory(eventsArtifactDirectory);
CreateDirectory(binariesArtifactDirectory);
CreateDirectory(packagesArtifactDirectory);

StartProcess(Context.Tools.Resolve("nbgv.*").ToString(), "cloud");
});

Teardown(context =>
@@ -335,22 +338,25 @@ Task("SignPackages")
throw new Exception("Client Secret not found, not signing packages.");
}

var nupkgs = GetFiles(packagesArtifactDirectory + "/*.nupkg");
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")
});
StartProcess(Context.Tools.Resolve("SignClient.*").ToString(), new ProcessSettings {
RedirectStandardOutput = true,
RedirectStandardError = true,
Arguments = new ProcessArgumentBuilder()
.Append("sign")
.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}");
}

0 comments on commit 741577c

Please sign in to comment.