Skip to content

Commit a438625

Browse files
committed
Adds a package sign step
1 parent 0915855 commit a438625

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

build.cake

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@ Task("Pack")
134134
Symbols = false
135135
});
136136
});
137+
138+
Task("Sign")
139+
.IsDependentOn("Pack")
140+
.WithCriteria(() => isLocal)
141+
.Does(() =>
142+
{
143+
var certPass = EnvironmentVariable("DAVIDGLICK_CERTPASS");
144+
if (string.IsNullOrEmpty(certPass))
145+
{
146+
throw new InvalidOperationException("Could not resolve certificate password.");
147+
}
148+
149+
foreach (var nupkg in GetFiles($"{ buildDir }/*.nupkg"))
150+
{
151+
StartProcess("nuget", "sign \"" + nupkg.ToString() + "\" -CertificatePath \"davidglick.pfx\" -CertificatePassword \"" + certPass + "\" -Timestamper \"http://timestamp.digicert.com\" -NonInteractive");
152+
}
153+
});
137154

138155
Task("Zip")
139156
.Description("Zips the build output.")
@@ -155,7 +172,7 @@ Task("Zip")
155172

156173
Task("NuGet")
157174
.Description("Pushes the packages to the NuGet gallery.")
158-
.IsDependentOn("Pack")
175+
.IsDependentOn("Sign")
159176
.WithCriteria(() => isLocal)
160177
.Does(() =>
161178
{

0 commit comments

Comments
 (0)