Skip to content

Commit e911ef7

Browse files
committed
Refactor NuGet publishing to use DotNet.nugetPush
1 parent b95406b commit e911ef7

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

Content/Library/build/build.fs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -590,15 +590,21 @@ let sourceLinkTest _ =
590590
let publishToNuget _ =
591591
allReleaseChecks ()
592592

593-
NuGet.NuGet.NuGetPublish(fun c -> {
594-
c with
595-
PublishUrl = "https://www.nuget.org"
596-
WorkingDir = "dist"
597-
AccessKey =
598-
match nugetToken with
599-
| Some s -> s
600-
| _ -> c.AccessKey
601-
})
593+
DotNet.nugetPush
594+
(fun c -> {
595+
c with
596+
Common = {
597+
c.Common with
598+
WorkingDirectory = distDir
599+
}
600+
PushParams = {
601+
c.PushParams with
602+
Source = Some publishUrl
603+
ApiKey = nugetToken
604+
}
605+
})
606+
"*.nupkg"
607+
602608
// If build fails after this point, we've pushed a release out with this version of CHANGELOG.md so we should keep it around
603609
Target.deactivateBuildFailure "RevertChangelog"
604610

build/build.fs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,20 @@ let dotnetPack ctx =
409409
let publishToNuget _ =
410410
allPublishChecks ()
411411

412-
NuGet.NuGet.NuGetPublish(fun c -> {
413-
c with
414-
PublishUrl = "https://www.nuget.org"
415-
WorkingDir = "dist"
416-
AccessKey =
417-
match nugetToken with
418-
| Some s -> s
419-
| _ -> c.AccessKey
420-
})
412+
DotNet.nugetPush
413+
(fun c -> {
414+
c with
415+
Common = {
416+
c.Common with
417+
WorkingDirectory = distDir
418+
}
419+
PushParams = {
420+
c.PushParams with
421+
Source = Some publishUrl
422+
ApiKey = nugetToken
423+
}
424+
})
425+
"*.nupkg"
421426

422427
let gitRelease _ =
423428
allReleaseChecks ()

0 commit comments

Comments
 (0)