diff --git a/build.cake b/build.cake index 9cb95eb4d0..19be109d93 100644 --- a/build.cake +++ b/build.cake @@ -149,7 +149,7 @@ Task("Upload-AppVeyor-Artifacts") "NuGetCommandLineBuild:GitVersion.CommandLine." + nugetVersion +".nupkg", "NuGetRefBuild:GitVersion." + nugetVersion +".nupkg", "NuGetTaskBuild:GitVersionTask." + nugetVersion +".nupkg", - "GitVersionTfsTaskBuild:gittools.gitversion." + semVersion +".vsix", + "GitVersionTfsTaskBuild:gittools.gitversion-" + semVersion +".vsix", "GemBuild:" + gem, "zip:GitVersion_" + nugetVersion + ".zip", "releaseNotes:releasenotes.md" diff --git a/deploy.cake b/deploy.cake index d55e231137..ec70f823be 100644 --- a/deploy.cake +++ b/deploy.cake @@ -1,5 +1,7 @@ #addin "Cake.Json" +var target = Argument("target", "Deploy"); + using System.Net; using System.Linq; using System.Collections.Generic; @@ -35,6 +37,7 @@ Task("EnsureRequirements") var tag = ""; Dictionary artifactLookup = null; +var publishingError = false; Task("UpdateVersionInfo") .IsDependentOn("EnsureRequirements") .Does(() => @@ -67,7 +70,7 @@ Task("Publish-NuGetPackage") .Does(() => { NuGetPush( - "./releaseArtifacts/" + artifactLookup["NuGetExeBuild"], + "./releaseArtifacts/" + artifactLookup["NuGetRefBuild"], new NuGetPushSettings { ApiKey = EnvironmentVariable("NuGetApiKey"), Source = "https://www.nuget.org/api/v2/package" @@ -135,9 +138,9 @@ Task("Publish-Gem") .IsDependentOn("DownloadGitHubReleaseArtifacts") .Does(() => { - var returnCode = StartProcess("gem", new ProcessSettings + var returnCode = StartProcess("cmd", new ProcessSettings { - Arguments = "push ./releaseArtifacts/" + artifactLookup["NuGetExeBuild"] + " --key " + EnvironmentVariable("GemApiKey") + Arguments = " /c gem push ./releaseArtifacts/" + artifactLookup["GemBuild"] + " --key " + EnvironmentVariable("GemApiKey") + " && exit 0 || exit 1" }); if (returnCode != 0) { @@ -151,9 +154,9 @@ Task("Publish-VstsTask") .IsDependentOn("DownloadGitHubReleaseArtifacts") .Does(() => { - var returnCode = StartProcess("tfx", new ProcessSettings + var returnCode = StartProcess("cmd", new ProcessSettings { - Arguments = "extension publish --vsix ./releaseArtifacts/" + artifactLookup["GitVersionTfsTaskBuild"] + " --no-prompt --auth-type pat --token " + EnvironmentVariable("GemApiKey") + Arguments = " /c tfx extension publish --vsix ./releaseArtifacts/" + artifactLookup["GitVersionTfsTaskBuild"] + " --no-prompt --auth-type pat --token " + EnvironmentVariable("MarketplaceApiKey") + " && exit 0 || exit 1" }); if (returnCode != 0) { @@ -167,7 +170,7 @@ Task("Deploy") .IsDependentOn("Publish-NuGetCommandLine") .IsDependentOn("Publish-MsBuildTask") .IsDependentOn("Publish-Chocolatey") - .IsDependentOn("Publish-Gem") +// .IsDependentOn("Publish-Gem") .IsDependentOn("Publish-VstsTask") .Finally(() => { @@ -175,4 +178,6 @@ Task("Deploy") { throw new Exception("An error occurred during the publishing of Cake. All publishing tasks have been attempted."); } -}); \ No newline at end of file +}); + +RunTarget(target); \ No newline at end of file diff --git a/deploy.ps1 b/deploy.ps1 index eaf1d62d9a..59f237466e 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -41,7 +41,7 @@ http://cakebuild.net [CmdletBinding()] Param( [string]$Script = "deploy.cake", - [string]$Target = "Default", + [string]$Target = "Deploy", [string]$Configuration = "Release", [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] [string]$Verbosity = "Verbose",