diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c00f4e7..34a0bad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,4 +28,4 @@ nuget-publish: - tags script: - dotnet tool restore - - dotnet nuke Publish + - dotnet nuke NuGetPush diff --git a/build/Build.cs b/build/Build.cs index 8796227..e78fe42 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -91,11 +91,13 @@ class Build : NukeBuild Target AddNugetSource => _ => _ .OnlyWhenStatic(() => GitRepository.IsOnMasterBranch()) .OnlyWhenStatic(() => CI != null) + .ProceedAfterFailure() .Executes(() => DotNetNuGetAddSource(s => s .SetName(NuGetSourceName) - .SetSource($"https://gitlab.com/api/v4/projects/{CI.ProjectId}/packages/nuget/index.json") - .SetUsername("gitlab-ci-token") - .SetPassword(CI.JobToken) + //.SetSource($"https://gitlab.com/api/v4/projects/{CI.ProjectId}/packages/nuget/index.json") + .SetSource($"https://gitlab.com/api/v4/projects/24385200/packages/nuget/index.json") + .SetUsername("baez90") + .SetPassword("RcMwfaXgvBxSWt4ZMB6z") .EnableStorePasswordInClearText())); Target Pack => _ => _ @@ -115,10 +117,13 @@ class Build : NukeBuild .EnableProcessLogOutput() ))); - Target Publish => _ => _ + Target NuGetPush => _ => _ .DependsOn(Pack, AddNugetSource) - .Executes(() => DotNetPublish(s => s - .EnableNoRestore() - .SetSources(NuGetSourceName) - .SetConfiguration(Configuration))); + .OnlyWhenStatic(() => GitRepository.IsOnMasterBranch()) + .Executes(() => ArtifactsDirectory + .GlobFiles("**/*.nupkg") + .ForEach(nupkg => DotNetNuGetPush(s => s + .SetSource(NuGetSourceName) + .SetTargetPath(nupkg) + .EnableProcessLogOutput()))); }