File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
138155Task ( "Zip" )
139156 . Description ( "Zips the build output." )
@@ -155,7 +172,7 @@ Task("Zip")
155172
156173Task ( "NuGet" )
157174 . Description ( "Pushes the packages to the NuGet gallery." )
158- . IsDependentOn ( "Pack " )
175+ . IsDependentOn ( "Sign " )
159176 . WithCriteria ( ( ) => isLocal )
160177 . Does ( ( ) =>
161178 {
You can’t perform that action at this time.
0 commit comments