Skip to content

Commit 5c7346c

Browse files
committed
enable the chocolatey push
1 parent c602fbb commit 5c7346c

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
ENABLED_PUBLISH_DOCKER: true
1616
ENABLED_PUBLISH_GEM: true
1717
ENABLED_PUBLISH_NUGET: true
18-
ENABLED_PUBLISH_CHOCOLATEY: false
18+
ENABLED_PUBLISH_CHOCOLATEY: true
1919

2020
jobs:
2121
build:

build/publish.cake

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Task("Publish-NuGet-Internal")
100100
if (FileExists(package.PackagePath))
101101
{
102102
// Push the package.
103-
NuGetPush(package.PackagePath, new NuGetPushSettings
103+
DotNetCoreNuGetPush(package.PackagePath.FullPath, new DotNetCoreNuGetPushSettings
104104
{
105105
ApiKey = apiKey,
106106
Source = apiUrl
@@ -137,13 +137,20 @@ Task("Publish-Chocolatey-Internal")
137137
{
138138
if (FileExists(package.PackagePath))
139139
{
140-
// Push the package.
141-
ChocolateyPush(package.PackagePath, new ChocolateyPushSettings
140+
try
142141
{
143-
ApiKey = apiKey,
144-
Source = apiUrl,
145-
Force = true
146-
});
142+
// Push the package.
143+
ChocolateyPush(package.PackagePath, new ChocolateyPushSettings
144+
{
145+
ApiKey = apiKey,
146+
Source = apiUrl,
147+
Force = true
148+
});
149+
}
150+
catch (System.Exception)
151+
{
152+
// chocolatey sometimes fails with an error, even if the package gets pushed
153+
}
147154
}
148155
}
149156
})

0 commit comments

Comments
 (0)