File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish NuGet Package
2+
3+ on :
4+ push :
5+ tags :
6+ - ' [0-9]+.[0-9]+.[0-9]+'
7+ - ' [0-9]+.[0-9]+.[0-9]+-*'
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+
17+ - name : Extract version from tag
18+ id : get_version
19+ run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
20+
21+ - name : Setup .NET 9.0
22+ uses : actions/setup-dotnet@v4
23+ with :
24+ dotnet-version : ' 9.0.x'
25+
26+ - name : Restore dependencies
27+ run : dotnet restore
28+
29+ - name : Build
30+ run : dotnet build --configuration Release --no-restore /p:Version=${{ steps.get_version.outputs.VERSION }}
31+
32+ - name : Pack
33+ run : dotnet pack --configuration Release --no-build --output ./artifacts /p:Version=${{ steps.get_version.outputs.VERSION }}
34+
35+ - name : Push to NuGet
36+ run : dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
37+
38+ - name : Create GitHub Release
39+ uses : softprops/action-gh-release@v1
40+ with :
41+ files : ./artifacts/*.nupkg
42+ generate_release_notes : true
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ EndProject
77Project ("{2150E333-8FDC-42A3-9474-1A3956D46DE8}" ) = "CI-CD" , "CI-CD" , "{816B745E-8A54-4CE9-A285-945EC121D5A9}"
88 Project Section (SolutionItems ) = preProject
99 ..\.github \workflows \docs -workflow .yml = ..\.github \workflows \docs -workflow .yml
10+ ..\.github \workflows \nuget -publish .yml = ..\.github \workflows \nuget -publish .yml
1011 EndProject Section
1112EndProject
1213Global
You can’t perform that action at this time.
0 commit comments