Skip to content

Commit

Permalink
housekeeping: fix signing to work/use nbgv from cake. (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Jan 7, 2019
1 parent 00eff40 commit 741577c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
10 changes: 0 additions & 10 deletions azure-pipelines.yml
Expand Up @@ -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:
Expand Down
28 changes: 17 additions & 11 deletions build.cake
Expand Up @@ -33,6 +33,7 @@
//////////////////////////////////////////////////////////////////////

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

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand Down Expand Up @@ -138,6 +139,8 @@ Setup(context =>
CreateDirectory(eventsArtifactDirectory);
CreateDirectory(binariesArtifactDirectory);
CreateDirectory(packagesArtifactDirectory);
StartProcess(Context.Tools.Resolve("nbgv.*").ToString(), "cloud");
});

Teardown(context =>
Expand Down Expand Up @@ -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}");
}
Expand Down

0 comments on commit 741577c

Please sign in to comment.