1
1
#addin "Cake.Json"
2
2
3
+ var target = Argument ( "target" , "Deploy" ) ;
4
+
3
5
using System . Net ;
4
6
using System . Linq ;
5
7
using System . Collections . Generic ;
@@ -35,6 +37,7 @@ Task("EnsureRequirements")
35
37
36
38
var tag = "" ;
37
39
Dictionary < string , string > artifactLookup = null ;
40
+ var publishingError = false ;
38
41
Task ( "UpdateVersionInfo" )
39
42
. IsDependentOn ( "EnsureRequirements" )
40
43
. Does ( ( ) =>
@@ -67,7 +70,7 @@ Task("Publish-NuGetPackage")
67
70
. Does ( ( ) =>
68
71
{
69
72
NuGetPush (
70
- "./releaseArtifacts/" + artifactLookup [ "NuGetExeBuild " ] ,
73
+ "./releaseArtifacts/" + artifactLookup [ "NuGetRefBuild " ] ,
71
74
new NuGetPushSettings {
72
75
ApiKey = EnvironmentVariable ( "NuGetApiKey" ) ,
73
76
Source = "https://www.nuget.org/api/v2/package"
@@ -135,9 +138,9 @@ Task("Publish-Gem")
135
138
. IsDependentOn ( "DownloadGitHubReleaseArtifacts" )
136
139
. Does ( ( ) =>
137
140
{
138
- var returnCode = StartProcess ( "gem " , new ProcessSettings
141
+ var returnCode = StartProcess ( "cmd " , new ProcessSettings
139
142
{
140
- Arguments = "push ./releaseArtifacts/" + artifactLookup [ "NuGetExeBuild " ] + " --key " + EnvironmentVariable ( "GemApiKey" )
143
+ Arguments = " /c gem push ./releaseArtifacts/" + artifactLookup [ "GemBuild " ] + " --key " + EnvironmentVariable ( "GemApiKey" ) + " && exit 0 || exit 1"
141
144
} ) ;
142
145
143
146
if ( returnCode != 0 ) {
@@ -151,9 +154,9 @@ Task("Publish-VstsTask")
151
154
. IsDependentOn ( "DownloadGitHubReleaseArtifacts" )
152
155
. Does ( ( ) =>
153
156
{
154
- var returnCode = StartProcess ( "tfx " , new ProcessSettings
157
+ var returnCode = StartProcess ( "cmd " , new ProcessSettings
155
158
{
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"
157
160
} ) ;
158
161
159
162
if ( returnCode != 0 ) {
@@ -167,12 +170,14 @@ Task("Deploy")
167
170
. IsDependentOn ( "Publish-NuGetCommandLine" )
168
171
. IsDependentOn ( "Publish-MsBuildTask" )
169
172
. IsDependentOn ( "Publish-Chocolatey" )
170
- . IsDependentOn ( "Publish-Gem" )
173
+ // .IsDependentOn("Publish-Gem")
171
174
. IsDependentOn ( "Publish-VstsTask" )
172
175
. Finally ( ( ) =>
173
176
{
174
177
if ( publishingError )
175
178
{
176
179
throw new Exception ( "An error occurred during the publishing of Cake. All publishing tasks have been attempted." ) ;
177
180
}
178
- } ) ;
181
+ } ) ;
182
+
183
+ RunTarget ( target ) ;
0 commit comments