Skip to content

Commit 89bd281

Browse files
authored
Added releasing to ci.yml
1 parent 250aa0f commit 89bd281

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
- develop
8+
tags:
9+
- '*.*.*'
810
pull_request:
911
branches:
1012
- main
@@ -14,6 +16,7 @@ on:
1416
permissions:
1517
checks: write
1618
statuses: write
19+
contents: write
1720

1821
jobs:
1922
build:
@@ -40,3 +43,19 @@ jobs:
4043

4144
- name: Run tests
4245
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
46+
47+
- name: Pack NuGet package
48+
if: startsWith(github.ref, 'refs/tags/')
49+
run: dotnet pack $SOLUTION --configuration $BUILD_CONFIG --no-build --output ./artifacts
50+
51+
- name: Publish to NuGet
52+
if: startsWith(github.ref, 'refs/tags/')
53+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
54+
55+
- name: Create GitHub Release
56+
if: startsWith(github.ref, 'refs/tags/')
57+
uses: softprops/action-gh-release@v1
58+
with:
59+
generate_release_notes: true
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)