@@ -29,79 +29,38 @@ jobs:
29
29
name : Build
30
30
31
31
- name : Test
32
- id : tests
33
- continue-on-error : true # so we can always publish the report
32
+ id : test
34
33
run : |
35
- dotnet test test/Serilog.Sinks.XUnit.Injectable.Tests.csproj \
36
- --configuration Release \
37
- --verbosity normal \
38
- -- \
39
- --report-ctrf \
40
- --report-ctrf-filename test-results.ctrf.json
41
- echo "exitcode=$?" >> "$GITHUB_OUTPUT"
34
+ dotnet test test/Serilog.Sinks.XUnit.Injectable.Tests.csproj --verbosity Normal
42
35
43
- # ──────────────────────────────
44
- # 2. Upload the raw report file (keeps history)
45
- # ──────────────────────────────
46
- - name : Upload CTRF artifact
47
- if : always()
48
- uses : actions/upload-artifact@v4
49
- with :
50
- name : ctrf-report
51
- path : test-results.ctrf.json
52
-
53
- # ──────────────────────────────
54
- # 3. Render the report in the job summary / PR
55
- # ──────────────────────────────
56
- - name : Publish Test Report
57
- if : always()
58
- uses : ctrf-io/github-test-reporter@v1
59
- with :
60
- report-path : test-results.ctrf.json # glob or file path is fine
61
- summary-report : true # job summary (default if no reports chosen)
62
- github-report : true # annotate PRs / Checks
63
- # add other reports as you like
64
- # ──────────────────────────────
65
- # 4. Fail the job *after* publishing if tests failed
66
- # ──────────────────────────────
67
- - name : Fail if tests failed
68
- if : steps.tests.outputs.exitcode != '0'
69
- run : exit 1
70
-
71
- # ──────────────────────────────
72
- # 5. Package & publish (runs only when tests passed)
73
- # ──────────────────────────────
74
36
- name : Pack
75
- if : success()
76
37
run : dotnet pack --no-build --configuration Release --output .
77
38
78
- - name : Publish to NuGet
79
- if : success()
80
- run : dotnet nuget push "**/*.nupkg" --source "https://api.nuget.org/v3/index.json" \
81
- --api-key "${{ secrets.NUGET__TOKEN }}" --skip-duplicate
39
+ - name : Publish to nuGet
40
+ run : dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET__TOKEN }} --skip-duplicate
82
41
83
42
- name : Add GitHub NuGet Source
84
- if : success()
85
43
run : |
86
- dotnet nuget add source https://nuget.pkg.github.com/soenneker/index.json \
87
- --name "github" \
88
- --username "any" \
89
- --password "${{ secrets.GH__TOKEN }}" \
90
- --store-password-in-clear-text
44
+ dotnet nuget add source https://nuget.pkg.github.com/soenneker/index.json \
45
+ --name "github" \
46
+ --username "any" \
47
+ --password "${{ secrets.GH__TOKEN }}" \
48
+ --store-password-in-clear-text
91
49
92
50
- name : Publish to GitHub Packages
93
- if : success()
94
- run : dotnet nuget push "**/*.nupkg" --source "github" --api-key "${{ secrets.GH__TOKEN }}"
51
+ run : |
52
+ dotnet nuget push ./*.nupkg \
53
+ --source "github" \
54
+ --api-key "${{ secrets.GH__TOKEN }}"
95
55
96
56
- name : Create GitHub Release
97
- if : success()
98
57
run : |
99
- changelog=$(git log -20 --pretty=format:"- %s")
100
- tag_name="v${BUILD_VERSION}"
101
- jq -n --arg tag_name "$tag_name" --arg name "$tag_name" --arg body "$changelog" \
102
- '{tag_name:$tag_name,name:$name,body:$body,draft:false,prerelease:false}' > payload.json
103
- curl -s -X POST \
104
- -H "Authorization: Bearer ${{ secrets.GH__TOKEN }}" \
105
- -H "Accept: application/vnd.github+json" \
106
- https://api.github.com/repos/${{ github.repository }}/releases \
107
- -d @payload.json
58
+ changelog=$(git log -20 --pretty=format:"- %s")
59
+ tag_name="v${BUILD_VERSION}"
60
+ jq -n --arg tag_name "$tag_name" --arg name "$tag_name" --arg body "$changelog" \
61
+ '{tag_name:$tag_name,name:$name,body:$body,draft:false,prerelease:false}' > payload.json
62
+ curl -s -X POST \
63
+ -H "Authorization: Bearer ${{ secrets.GH__TOKEN }}" \
64
+ -H "Accept: application/vnd.github+json" \
65
+ https://api.github.com/repos/${{ github.repository }}/releases \
66
+ -d @payload.json
0 commit comments