11#addin "Cake.Json"
22
3+ var target = Argument ( "target" , "Deploy" ) ;
4+
35using System . Net ;
46using System . Linq ;
57using System . Collections . Generic ;
@@ -35,6 +37,7 @@ Task("EnsureRequirements")
3537
3638var tag = "" ;
3739Dictionary < string , string > artifactLookup = null ;
40+ var publishingError = false ;
3841Task ( "UpdateVersionInfo" )
3942 . IsDependentOn ( "EnsureRequirements" )
4043 . Does ( ( ) =>
@@ -67,7 +70,7 @@ Task("Publish-NuGetPackage")
6770 . Does ( ( ) =>
6871{
6972 NuGetPush (
70- "./releaseArtifacts/" + artifactLookup [ "NuGetExeBuild " ] ,
73+ "./releaseArtifacts/" + artifactLookup [ "NuGetRefBuild " ] ,
7174 new NuGetPushSettings {
7275 ApiKey = EnvironmentVariable ( "NuGetApiKey" ) ,
7376 Source = "https://www.nuget.org/api/v2/package"
@@ -135,9 +138,9 @@ Task("Publish-Gem")
135138 . IsDependentOn ( "DownloadGitHubReleaseArtifacts" )
136139 . Does ( ( ) =>
137140{
138- var returnCode = StartProcess ( "gem " , new ProcessSettings
141+ var returnCode = StartProcess ( "cmd " , new ProcessSettings
139142 {
140- Arguments = "push ./releaseArtifacts/" + artifactLookup [ "NuGetExeBuild " ] + " --key " + EnvironmentVariable ( "GemApiKey" )
143+ Arguments = " /c gem push ./releaseArtifacts/" + artifactLookup [ "GemBuild " ] + " --key " + EnvironmentVariable ( "GemApiKey" ) + " && exit 0 || exit 1"
141144 } ) ;
142145
143146 if ( returnCode != 0 ) {
@@ -151,9 +154,9 @@ Task("Publish-VstsTask")
151154 . IsDependentOn ( "DownloadGitHubReleaseArtifacts" )
152155 . Does ( ( ) =>
153156{
154- var returnCode = StartProcess ( "tfx " , new ProcessSettings
157+ var returnCode = StartProcess ( "cmd " , new ProcessSettings
155158 {
156- Arguments = "extension publish --vsix ./releaseArtifacts/" + artifactLookup [ "GitVersionTfsTaskBuild" ] + " --no-prompt --auth-type pat --token " + EnvironmentVariable ( "GemApiKey" )
159+ Arguments = " /c tfx extension publish --vsix ./releaseArtifacts/" + artifactLookup [ "GitVersionTfsTaskBuild" ] + " --no-prompt --auth-type pat --token " + EnvironmentVariable ( "MarketplaceApiKey" ) + " && exit 0 || exit 1"
157160 } ) ;
158161
159162 if ( returnCode != 0 ) {
@@ -167,12 +170,14 @@ Task("Deploy")
167170 . IsDependentOn ( "Publish-NuGetCommandLine" )
168171 . IsDependentOn ( "Publish-MsBuildTask" )
169172 . IsDependentOn ( "Publish-Chocolatey" )
170- . IsDependentOn ( "Publish-Gem" )
173+ // .IsDependentOn("Publish-Gem")
171174 . IsDependentOn ( "Publish-VstsTask" )
172175 . Finally ( ( ) =>
173176{
174177 if ( publishingError )
175178 {
176179 throw new Exception ( "An error occurred during the publishing of Cake. All publishing tasks have been attempted." ) ;
177180 }
178- } ) ;
181+ } ) ;
182+
183+ RunTarget ( target ) ;
0 commit comments