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+ # This workflow will build a .NET project
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+ name : CD
5+
6+ on :
7+ push :
8+ branches : [ "main" ]
9+ pull_request :
10+ branches : [ "main" ]
11+
12+ jobs :
13+ build :
14+
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
21+ - name : Setup .NET
22+ uses : actions/setup-dotnet@v4
23+ with :
24+ dotnet-version : 10.0.x
25+ - name : Install GitVersioning
26+ run : dotnet tool install --global nbgv
27+ - name : Set version
28+ id : version
29+ run : echo "::set-output name=VERSION::$(nbgv get-version -v AssemblyInformationalVersion)"
30+ - name : Restore dependencies
31+ run : dotnet restore
32+ - name : Build
33+ run : dotnet build --no-restore
34+ - name : Test
35+ run : dotnet test --no-build --verbosity normal
36+ - name : Pack
37+ run : dotnet pack --configuration Release --output ./nupkg /p:PackageVersion=${{ steps.version.outputs.VERSION }}
38+ - name : Publish to NuGet
39+ run : dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
40+ - name : Publish to GitHub Packages
41+ run : dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.PUSH_GITHUB_PACKAGES }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
You can’t perform that action at this time.
0 commit comments