Skip to content

Commit 7ef2483

Browse files
authored
Create main.yml
1 parent d9f25f8 commit 7ef2483

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: '9.0.x'
19+
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
23+
- name: Build
24+
run: dotnet build --configuration Release --no-restore
25+
26+
- name: Test
27+
run: dotnet test --no-restore --verbosity normal
28+
29+
- name: Pack
30+
run: dotnet pack --configuration Release --no-build --output nupkgs
31+
32+
- name: Push to NuGet
33+
run: |
34+
cd nupkgs
35+
for f in *.nupkg
36+
do
37+
dotnet nuget push $f --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
done

0 commit comments

Comments
 (0)