File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed 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 : .NET
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+ - name : Setup .NET
20+ uses : actions/setup-dotnet@v4
21+ with :
22+ dotnet-version : 8.0.x
23+ - name : Restore dependencies
24+ run : dotnet restore
25+ - name : Build
26+ run : dotnet build --no-restore
27+ - name : Test
28+ run : dotnet test --no-build --verbosity normal
29+ - name : Upload packages as artifacts
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : nuget packages
33+ path : " **/*.nupkg"
34+ - name : Push to GitHub Feed
35+ if : ${{ github.event_name != 'pull_request' }}
36+ run : dotnet nuget push **/*.nupkg --source https://nuget.pkg.github.com/${REPOSITORY_OWNER}/index.json --api-key ${GITHUB_TOKEN} --skip-duplicate
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+ REPOSITORY_OWNER : ${{ github.repository_owner }}
40+
41+ release :
42+ if : startsWith(github.ref, 'refs/tags')
43+ runs-on : ubuntu-latest
44+ timeout-minutes : 5
45+ needs : [build]
46+ steps :
47+ - uses : actions/download-artifact@v4
48+ with :
49+ name : nuget packages
50+ - name : Push generated package to NuGet
51+ run : dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
You can’t perform that action at this time.
0 commit comments