File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Publish NuGet
2+
3+ on :
4+ release :
5+ types : [created]
6+ workflow_dispatch :
7+
8+ jobs :
9+ build-and-push :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : Setup .NET
15+ uses : actions/setup-dotnet@v4
16+ with :
17+ dotnet-version : ' 8.0.x'
18+
19+ - name : Extract release version
20+ id : release_version
21+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
22+
23+ - name : Restore dependencies
24+ run : dotnet restore
25+
26+ - name : Build
27+ run : dotnet build --configuration Release --no-restore
28+
29+ - name : Test
30+ run : dotnet test --no-restore --verbosity normal
31+
32+ - name : Pack
33+ run : dotnet pack --configuration Release --no-build --output nupkgs /p:PackageVersion=${{ env.RELEASE_VERSION }}
34+
35+ - name : Push to NuGet
36+ run : dotnet nuget push "nupkgs/**/*.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