Skip to content

Commit 68ab11e

Browse files
committed
Added publish GitHub workflow
1 parent a1b5249 commit 68ab11e

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
id-token: write
11+
contents: read
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: |
25+
10.0.x
26+
27+
- name: Install Cake
28+
run: dotnet tool restore
29+
30+
- name: Run Cake Publish target
31+
run: dotnet cake --target=Pack

build.cake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ Task("Publish")
245245
{
246246
foreach(var package in System.IO.Directory.GetFiles(PACKAGE_DIR, "*.nupkg").Where(o => !o.Contains("symbols")))
247247
{
248-
NuGetPush(package, new NuGetPushSettings()
248+
DotNetNuGetPush(package, new DotNetNuGetPushSettings()
249249
{
250-
Source = "https://api.nuget.org/v3/index.json"
250+
Source = "https://api.nuget.org/v3/index.json",
251+
SkipDuplicate = true
251252
});
252253
}
253254
});

0 commit comments

Comments
 (0)