Skip to content
Snippets Groups Projects

Fix: nuget push

Merged L. Ellenbeck requested to merge Topic/570-gitVersion into master
1 file
+ 16
10
Compare changes
  • Side-by-side
  • Inline
+ 16
10
@@ -296,16 +296,21 @@ Task("NugetPush")
.Does(() =>{
var nupkgs = GetFiles($"{nupkgDir}/*.nupkg");
Information("Need to push {0} packages", nupkgs.Count);
foreach(var nupkg in nupkgs) {
Information("Pushing {0}", nupkg);
NuGetPush(nupkg, new NuGetPushSettings {
Source = nugetSource,
ApiKey = nugetApiKey
});
if(!String.IsNullOrWhiteSpace(nugetApiKey)) {
foreach(var nupkg in nupkgs) {
Information("Pushing {0}", nupkg);
NuGetPush(nupkg, new NuGetPushSettings {
Source = nugetSource,
ApiKey = nugetApiKey
});
}
} else {
Information("NugetApiKey is not set. Can't push.");
throw new Exception("NugetApiKey is not set. Can't push.");
}
});
Task("MoveToArtifacts")
Task("CopyToArtifacts")
.Does(() =>{
foreach(var project in projects) {
if(!project.GetDirectory().ToString().EndsWith(".Tests")
@@ -320,11 +325,12 @@ Task("MoveToArtifacts")
Task("Prerelease")
.IsDependentOn("Build")
.IsDependentOn("MoveToArtifacts");
.IsDependentOn("CopyToArtifacts");
Task("Release")
.IsDependentOn("NugetPush")
.IsDependentOn("MoveToArtifacts");
.IsDependentOn("NugetPack")
.IsDependentOn("CopyToArtifacts")
.IsDependentOn("NugetPush");
Task("Default")
.IsDependentOn("Test");
Loading