File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish NuGet package
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ env :
8+ ARTIFACTS_FEED_URL : https://api.nuget.org/v3/index.json
9+ BUILD_CONFIGURATION : " Release"
10+ DOTNET_VERSION : " 8.x"
11+
12+ jobs :
13+ build-pack-push :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+
19+ - name : Setup .NET
20+ uses : actions/setup-dotnet@v4
21+ with :
22+ dotnet-version : ${{ env.DOTNET_VERSION }}
23+ source-url : ${{ env.ARTIFACTS_FEED_URL }}
24+ env :
25+ NUGET_AUTH_TOKEN : ${{ secrets.NUGET_API_KEY_NEOLUTION }}
26+
27+ - name : Determine version for NuGet package
28+ run : echo NUGET_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV
29+
30+ - name : Build and pack
31+ run : |
32+ dotnet restore
33+ dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} -p:Version=$NUGET_VERSION
34+ dotnet pack --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore --no-build -p:PackageVersion=$NUGET_VERSION
35+
36+ - name : Push NuGet package
37+ run : echo "dotnet nuget push -k $NUGET_AUTH_TOKEN **/bin/Release/*.nupkg"
38+ env :
39+ NUGET_AUTH_TOKEN : ${{ secrets.NUGET_API_KEY_NEOLUTION }}
You can’t perform that action at this time.
0 commit comments