File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 1- name : Publish NuGet Package
1+ name : Publish NuGet Package on Tag
22
33on :
44 push :
5- branches :
6- - main
5+ tags :
6+ - ' v*.*.* '
77
88jobs :
99 publish :
@@ -12,20 +12,29 @@ jobs:
1212 steps :
1313 - name : Checkout code
1414 uses : actions/checkout@v3
15+ with :
16+ fetch-depth : 0
1517
16- - name : Setup .NET SDK
18+ - name : Setup .NET
1719 uses : actions/setup-dotnet@v4
1820 with :
1921 dotnet-version : 10.0.x
2022
21- - name : Restore dependencies
23+ - name : Extract tag version
24+ id : tag_version
25+ run : |
26+ TAG=${GITHUB_REF#refs/tags/}
27+ echo "TAG_VERSION=${TAG#v}" >> $GITHUB_OUTPUT
28+
29+ - name : Restore
2230 run : dotnet restore
2331
2432 - name : Build
2533 run : dotnet build --configuration Release --no-restore
2634
27- - name : Pack NuGet
28- run : dotnet pack --configuration Release --no-build -o out
35+ - name : Pack
36+ run : dotnet pack --configuration Release --no-build -o out \
37+ -p:PackageVersion=${{ steps.tag_version.outputs.TAG_VERSION }}
2938
3039 - name : Push to NuGet
3140 run : dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
You can’t perform that action at this time.
0 commit comments