Skip to content
Snippets Groups Projects
Commit 087dba28 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Fix: nuget push

parent 5fe74276
No related branches found
No related tags found
1 merge request!19Fix: nuget push
...@@ -296,16 +296,21 @@ Task("NugetPush") ...@@ -296,16 +296,21 @@ Task("NugetPush")
.Does(() =>{ .Does(() =>{
var nupkgs = GetFiles($"{nupkgDir}/*.nupkg"); var nupkgs = GetFiles($"{nupkgDir}/*.nupkg");
Information("Need to push {0} packages", nupkgs.Count); Information("Need to push {0} packages", nupkgs.Count);
if(!String.IsNullOrWhiteSpace(nugetApiKey)) {
foreach(var nupkg in nupkgs) { foreach(var nupkg in nupkgs) {
Information("Pushing {0}", nupkg); Information("Pushing {0}", nupkg);)
NuGetPush(nupkg, new NuGetPushSettings { NuGetPush(nupkg, new NuGetPushSettings {
Source = nugetSource, Source = nugetSource,
ApiKey = nugetApiKey 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(() =>{ .Does(() =>{
foreach(var project in projects) { foreach(var project in projects) {
if(!project.GetDirectory().ToString().EndsWith(".Tests") if(!project.GetDirectory().ToString().EndsWith(".Tests")
...@@ -320,11 +325,12 @@ Task("MoveToArtifacts") ...@@ -320,11 +325,12 @@ Task("MoveToArtifacts")
Task("Prerelease") Task("Prerelease")
.IsDependentOn("Build") .IsDependentOn("Build")
.IsDependentOn("MoveToArtifacts"); .IsDependentOn("CopyToArtifacts");
Task("Release") Task("Release")
.IsDependentOn("NugetPush") .IsDependentOn("NugetPack")
.IsDependentOn("MoveToArtifacts"); .IsDependentOn("CopyToArtifacts")
.IsDependentOn("NugetPush");
Task("Default") Task("Default")
.IsDependentOn("Test"); .IsDependentOn("Test");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment