@@ -9,38 +9,56 @@ permissions:
99 packages : write
1010
1111jobs :
12- build :
13- name : Build
12+ build-and-publish :
13+ name : Build and Publish
1414
1515 runs-on : ubuntu-latest
1616
1717 env :
1818 GH_TOKEN : ${{ github.token }}
1919
2020 steps :
21- - uses : actions/checkout@v2
21+ - uses : actions/checkout@v4
22+
23+ - name : Set release information
24+ run : gh release edit ${{ github.ref_name }} -n "$(echo -e '***[Pre-release is being automatically created, please wait...](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})***\n\n${{ github.event.release.body }}')"
2225
2326 - name : Setup .NET
24- uses : actions/setup-dotnet@v1
27+ uses : actions/setup-dotnet@v4
2528 with :
2629 dotnet-version : |
27- 7.0.x
28- 6.0.x
30+ 8.0.x
2931
3032 - name : Restore dependencies
3133 run : dotnet restore
3234
3335 - name : Build
34- run : dotnet build -c Release --no-restore
36+ run : dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true
3537
3638 - name : Test
37- run : dotnet test -c Release --no-build --verbosity normal
39+ run : dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
40+
41+ - name : Code Coverage Report
42+ 43+ with :
44+ filename : coverage/**/coverage.cobertura.xml
45+ badge : true
46+ fail_below_min : true
47+ format : text
48+ hide_branch_rate : false
49+ hide_complexity : true
50+ indicators : true
51+ output : both
52+ thresholds : ' 60 80'
3853
3954 - name : Publish the package to nuget.org
4055 run : dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
4156
4257 - name : Publish the package to github.com
43- run : dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ env.GH_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json
44-
58+ run : dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json
59+
4560 - name : Upload the package to this release
4661 run : gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg
62+
63+ - name : Set release information
64+ run : gh release edit ${{ github.ref_name }} -n "$(echo -e '${{ github.event.release.body }}\n\nAssets were automatically generated using the [publish workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).')"
0 commit comments