Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore errors in DotNetPushChocolateyPackage when IGNORE_CONFLICT is true #2809

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ Target.create "DotNetCreateDebianPackage" (fun _ ->
Target.create "DotNetPushChocolateyPackage" (fun _ ->
let name = sprintf "%s.%s.nupkg" "fake" chocoVersion
let path = sprintf "%s/%s" chocoReleaseDir name
let ignore_conflict = Environment.environVar "IGNORE_CONFLICT" = "true"

if not Environment.isWindows && not (File.exists path) && fromArtifacts then
Directory.ensure chocoReleaseDir
Expand All @@ -975,12 +976,15 @@ Target.create "DotNetPushChocolateyPackage" (fun _ ->
else
{ p with ToolPath = altToolPath }

path
|> Choco.push (fun p ->
{ p with
Source = chocoSource
ApiKey = chocoKey.Value }
|> changeToolPath))
try
path
|> Choco.push (fun p ->
{ p with
Source = chocoSource
ApiKey = chocoKey.Value }
|> changeToolPath)
with exn when ignore_conflict ->
Trace.traceFAKE "ignore conflict error because IGNORE_CONFLICT=true!")

Target.create "DotNetPushToNuGet" (fun _ ->
!!(appDir </> "*/*.fsproj") -- (appDir </> "Fake.netcore/*.fsproj")
Expand Down
Loading