File tree Expand file tree Collapse file tree 1 file changed +21
-35
lines changed
Expand file tree Collapse file tree 1 file changed +21
-35
lines changed Original file line number Diff line number Diff line change @@ -2,44 +2,30 @@ name: Publish NuGet Package
22
33on :
44 push :
5- tags :
6- - ' v*.*.* ' # فقط زمانی اجرا میشه که tag مثل v1.2.3 اضافه بشه
5+ branches :
6+ - main
77
88jobs :
99 publish :
1010 runs-on : ubuntu-latest
1111
1212 steps :
13- - name : Checkout code
14- uses : actions/checkout@v3
15-
16- - name : Setup .NET
17- uses : actions/setup-dotnet@v4
18- with :
19- dotnet-version : |
20- 6.0.x
21- 8.0.x
22- 10.0.100-preview.4
23-
24- - name : Extract version from tag
25- id : tag
26- run : |
27- echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
28-
29- - name : Restore dependencies
30- run : dotnet restore
31-
32- - name : Build
33- run : dotnet build --configuration Release --no-restore
34-
35- - name : Pack NuGet
36- run : |
37- dotnet pack --configuration Release \
38- -p:PackageVersion=${{ steps.tag.outputs.VERSION }} \
39- --no-build -o out
40-
41- - name : Push to NuGet
42- run : |
43- dotnet nuget push out/*.nupkg \
44- --api-key ${{ secrets.NUGET_API_KEY }} \
45- --source https://api.nuget.org/v3/index.json
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+
16+ - name : Setup .NET SDK
17+ uses : actions/setup-dotnet@v4
18+ with :
19+ dotnet-version : 8.0.x
20+
21+ - name : Restore dependencies
22+ run : dotnet restore
23+
24+ - name : Build
25+ run : dotnet build --configuration Release --no-restore
26+
27+ - name : Pack NuGet
28+ run : dotnet pack --configuration Release --no-build -o out
29+
30+ - name : Push to NuGet
31+ 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