55# SPDX-License-Identifier: MIT
66
77name : Build
8+ run-name : Build
89
910on :
1011 push :
1112 branches :
1213 - main
14+ - next
1315 - release/*
1416 tags :
1517 - release/*
2022 workflow_dispatch :
2123 # no options
2224
25+ permissions :
26+ contents : write # required by ncipollo/release-action@v1
27+
2328env :
2429 # Minimize noise from dotnet CLI
2530 DOTNET_NOLOGO : 1
@@ -32,20 +37,16 @@ jobs:
3237
3338 steps :
3439 - name : Check Out Code
35- uses : actions/checkout@v2
40+ uses : actions/checkout@v4
3641 # url: https://github.com/actions/checkout
3742
38- - name : Configure .NET Core 3.1
39- uses : actions/setup-dotnet@v1
43+ - name : Configure .NET
44+ uses : actions/setup-dotnet@v4
4045 # url: https://github.com/actions/setup-dotnet
4146 with :
42- dotnet-version : 3.1.x
43-
44- - name : Configure .NET 6.0
45- uses : actions/setup-dotnet@v1
46- # url: https://github.com/actions/setup-dotnet
47- with :
48- dotnet-version : 6.0.x
47+ dotnet-version : |
48+ 6.0.x
49+ 8.0.x
4950
5051 - name : Stamp Version
5152 id : stamp
5758 -p:Counter=${{ github.run_number }}
5859 -p:RepositoryCommit=${{ github.sha }}
5960
61+ - name : Publish Version
62+ shell : pwsh
63+ run : |
64+ Add-Content $env:GITHUB_STEP_SUMMARY @"
65+ | | |
66+ |:-----------|:----------------------------------|
67+ | Version | ``$env:VERSION`` |
68+ | Branch/Tag | ``$env:GITHUB_REF`` $env:HEAD_REF |
69+ | Commit | ``$env:GITHUB_SHA`` $env:HEAD_SHA |`n`n
70+ "@
71+ env :
72+ VERSION : ${{ steps.stamp.outputs.version }}
73+ HEAD_REF : ${{ github.event.pull_request && format('(head = `{0}`)', github.event.pull_request.head.ref) }}
74+ HEAD_SHA : ${{ github.event.pull_request && format('(head = `{0}`)', github.event.pull_request.head.sha) }}
75+
6076 - name : Restore NuGet Packages
6177 run : dotnet restore
6278
@@ -73,24 +89,34 @@ jobs:
7389 --results-directory:${{ runner.temp }}\coverage\raw
7490
7591 - name : Prepare Coverage Report
76- uses : danielpalme/ReportGenerator-GitHub-Action@5.1.6
92+ uses : danielpalme/ReportGenerator-GitHub-Action@5
7793 # url: https://github.com/danielpalme/ReportGenerator-GitHub-Action
7894 with :
7995 reports : ${{ runner.temp }}\coverage\raw\**\coverage.opencover.xml
8096 targetdir : ${{ runner.temp }}\coverage
81- reporttypes : Cobertura;JsonSummary;Html_Dark ;Badges
97+ reporttypes : Html;MarkdownSummaryGithub ;Badges
8298 verbosity : Warning
8399
100+ - name : Publish Coverage Summary
101+ shell : pwsh
102+ run : |
103+ Add-Content $env:GITHUB_STEP_SUMMARY @(
104+ "## Coverage`n"
105+ Select-String '^#' $env:REPORT_PATH -NotMatch -Raw
106+ )
107+ env :
108+ REPORT_PATH : ${{ runner.temp }}\coverage\SummaryGithub.md
109+
84110 - name : Save Coverage Report
85- uses : actions/upload-artifact@v2
111+ uses : actions/upload-artifact@v4
86112 # url: https://github.com/actions/upload-artifact
87113 with :
88114 name : Coverage Report
89115 path : ${{ runner.temp }}\coverage
90116 if-no-files-found : error
91117
92118 - name : Save Package
93- uses : actions/upload-artifact@v2
119+ uses : actions/upload-artifact@v4
94120 # url: https://github.com/actions/upload-artifact
95121 with :
96122 name : Packages
0 commit comments