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
|
- tags
|
||||||
script:
|
script:
|
||||||
- dotnet tool restore
|
- dotnet tool restore
|
||||||
- dotnet nuke Publish
|
- dotnet nuke NuGetPush
|
||||||
|
|
|
@ -91,11 +91,13 @@ class Build : NukeBuild
|
||||||
Target AddNugetSource => _ => _
|
Target AddNugetSource => _ => _
|
||||||
.OnlyWhenStatic(() => GitRepository.IsOnMasterBranch())
|
.OnlyWhenStatic(() => GitRepository.IsOnMasterBranch())
|
||||||
.OnlyWhenStatic(() => CI != null)
|
.OnlyWhenStatic(() => CI != null)
|
||||||
|
.ProceedAfterFailure()
|
||||||
.Executes(() => DotNetNuGetAddSource(s => s
|
.Executes(() => DotNetNuGetAddSource(s => s
|
||||||
.SetName(NuGetSourceName)
|
.SetName(NuGetSourceName)
|
||||||
.SetSource($"https://gitlab.com/api/v4/projects/{CI.ProjectId}/packages/nuget/index.json")
|
//.SetSource($"https://gitlab.com/api/v4/projects/{CI.ProjectId}/packages/nuget/index.json")
|
||||||
.SetUsername("gitlab-ci-token")
|
.SetSource($"https://gitlab.com/api/v4/projects/24385200/packages/nuget/index.json")
|
||||||
.SetPassword(CI.JobToken)
|
.SetUsername("baez90")
|
||||||
|
.SetPassword("RcMwfaXgvBxSWt4ZMB6z")
|
||||||
.EnableStorePasswordInClearText()));
|
.EnableStorePasswordInClearText()));
|
||||||
|
|
||||||
Target Pack => _ => _
|
Target Pack => _ => _
|
||||||
|
@ -115,10 +117,13 @@ class Build : NukeBuild
|
||||||
.EnableProcessLogOutput()
|
.EnableProcessLogOutput()
|
||||||
)));
|
)));
|
||||||
|
|
||||||
Target Publish => _ => _
|
Target NuGetPush => _ => _
|
||||||
.DependsOn(Pack, AddNugetSource)
|
.DependsOn(Pack, AddNugetSource)
|
||||||
.Executes(() => DotNetPublish(s => s
|
.OnlyWhenStatic(() => GitRepository.IsOnMasterBranch())
|
||||||
.EnableNoRestore()
|
.Executes(() => ArtifactsDirectory
|
||||||
.SetSources(NuGetSourceName)
|
.GlobFiles("**/*.nupkg")
|
||||||
.SetConfiguration(Configuration)));
|
.ForEach(nupkg => DotNetNuGetPush(s => s
|
||||||
|
.SetSource(NuGetSourceName)
|
||||||
|
.SetTargetPath(nupkg)
|
||||||
|
.EnableProcessLogOutput())));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue