@@ -2,55 +2,74 @@ name: CI/CD Pipeline
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
6+ paths-ignore :
7+ - " docs/**"
8+ - " **.md"
9+ - " .github/ISSUE_TEMPLATE/**"
10+ - " .claude/**"
611 pull_request :
7- branches : [ main ]
12+ branches : [main]
13+ paths-ignore :
14+ - " docs/**"
15+ - " **.md"
16+ - " .github/ISSUE_TEMPLATE/**"
17+ - " .claude/**"
818 release :
9- types : [ published ]
19+ types : [published]
20+
21+ concurrency :
22+ group : ${{ github.workflow }}-${{ github.ref }}
23+ cancel-in-progress : true
1024
1125jobs :
1226 build-and-test :
1327 runs-on : ubuntu-latest
14-
28+
1529 steps :
16- - uses : actions/checkout@v4
17-
18- - name : Setup .NET
19- uses : actions/setup-dotnet@v4
20- with :
21- dotnet-version : 9.x.x
22-
23- - name : Restore dependencies
24- run : dotnet restore
25-
26- - name : Build
27- run : dotnet build --no-restore --configuration Release
28-
29- - name : Test
30- run : dotnet test --no-build --configuration Release --verbosity normal
30+ - uses : actions/checkout@v4
31+
32+ - name : Setup .NET
33+ uses : actions/setup-dotnet@v4
34+ with :
35+ dotnet-version : 9.x
36+
37+ - name : Restore dependencies
38+ run : dotnet restore
39+
40+ - name : Check formatting
41+ run : |
42+ dotnet tool restore
43+ dotnet csharpier . --check
44+
45+ - name : Build
46+ run : dotnet build --no-restore --configuration Release
47+
48+ - name : Test
49+ run : dotnet test --no-build --configuration Release --verbosity normal
3150
3251 publish :
3352 needs : build-and-test
3453 if : github.event_name == 'release'
3554 runs-on : ubuntu-latest
36-
55+
3756 steps :
38- - uses : actions/checkout@v4
39-
40- - name : Setup .NET
41- uses : actions/setup-dotnet@v4
42- with :
43- dotnet-version : 9.x .x
44- source-url : https://nuget.pkg.github.com/Intility/index.json
45- env :
46- NUGET_AUTH_TOKEN : ${{ secrets.NUGET_AUTH_TOKEN }}
47-
48- - name : Build and Pack
49- run : |
50- VERSION="${{ github.event.release.tag_name }}"
51- # Remove v prefix if present
52- [[ "$VERSION" =~ ^v ]] && VERSION="${VERSION:1}"
53- dotnet pack JsonApiToolkit/JsonApiToolkit.csproj -p:PackageVersion=$VERSION -c Release
54-
55- - name : Publish to GitHub Packages
56- run : dotnet nuget push "JsonApiToolkit/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_AUTH_TOKEN }}
57+ - uses : actions/checkout@v4
58+
59+ - name : Setup .NET
60+ uses : actions/setup-dotnet@v4
61+ with :
62+ dotnet-version : 9.x
63+ source-url : https://nuget.pkg.github.com/Intility/index.json
64+ env :
65+ NUGET_AUTH_TOKEN : ${{ secrets.NUGET_AUTH_TOKEN }}
66+
67+ - name : Build and Pack
68+ run : |
69+ VERSION="${{ github.event.release.tag_name }}"
70+ # Remove v prefix if present
71+ [[ "$VERSION" =~ ^v ]] && VERSION="${VERSION:1}"
72+ dotnet pack JsonApiToolkit/JsonApiToolkit.csproj -p:PackageVersion=$VERSION -c Release
73+
74+ - name : Publish to GitHub Packages
75+ run : dotnet nuget push "JsonApiToolkit/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_AUTH_TOKEN }}
0 commit comments