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

Merge branch 'Topic/570-gitVersion' into 'master'

Fix: nuget push

See merge request coscine/cs/exampleproject!19
parents f09b4a86 d198e5ac
No related branches found
No related tags found
1 merge request!19Fix: nuget push
......@@ -296,6 +296,7 @@ Task("NugetPush")
.Does(() =>{
var nupkgs = GetFiles($"{nupkgDir}/*.nupkg");
Information("Need to push {0} packages", nupkgs.Count);
if(!String.IsNullOrWhiteSpace(nugetApiKey)) {
foreach(var nupkg in nupkgs) {
Information("Pushing {0}", nupkg);
NuGetPush(nupkg, new NuGetPushSettings {
......@@ -303,9 +304,13 @@ Task("NugetPush")
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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment