File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI/CD
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+ tags :
9+ - " v[0-9]+.[0-9]+.[0-9]+"
10+
11+ jobs :
12+ build-and-test :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Setup .NET
19+ uses : actions/setup-dotnet@v4
20+
21+ - name : Restore dependencies
22+ run : dotnet restore
23+
24+ - name : Build
25+ run : dotnet build --configuration Release --no-restore
26+
27+ - name : Test
28+ run : dotnet test --no-restore --verbosity normal
29+
30+ publish :
31+ needs : build-and-test
32+ if : startsWith(github.ref, 'refs/tags/v')
33+ runs-on : ubuntu-latest
34+
35+ steps :
36+ - uses : actions/checkout@v4
37+
38+ - name : Setup .NET
39+ uses : actions/setup-dotnet@v4
40+
41+ - name : Pack
42+ run : dotnet pack --configuration Release --output nupkgs
43+
44+ - name : Push to NuGet
45+ run : dotnet nuget push nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
You can’t perform that action at this time.
0 commit comments