Fix NuGet push in CI
This commit is contained in:
parent
428c414f7a
commit
52fe1b54e6
2 changed files with 14 additions and 9 deletions
|
@ -28,4 +28,4 @@ nuget-publish:
|
|||
- tags
|
||||
script:
|
||||
- dotnet tool restore
|
||||
- dotnet nuke Publish
|
||||
- dotnet nuke NuGetPush
|
||||
|
|
|
@ -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())));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue