@@ -23,6 +23,7 @@ concurrency:
2323env :
2424 DOTNET_NOLOGO : true
2525 DOTNET_CLI_TELEMETRY_OPTOUT : true
26+ SOLUTION_FILE : JsonApiDotNetCore.sln
2627
2728jobs :
2829 build-and-test :
@@ -38,24 +39,27 @@ jobs:
3839 - name : Tune GitHub-hosted runner network
3940 uses : smorimoto/tune-github-hosted-runner-network@v1
4041 - name : Setup PostgreSQL
41- uses : ikalnytskyi/action-setup-postgres@v6
42+ uses : ikalnytskyi/action-setup-postgres@v8
4243 with :
4344 username : postgres
4445 password : postgres
4546 - name : Setup .NET
46- uses : actions/setup-dotnet@v4
47+ uses : actions/setup-dotnet@v5
4748 with :
4849 dotnet-version : |
4950 8.0.*
5051 9.0.*
52+ 10.0.*
5153 - name : Show installed versions
5254 shell : pwsh
5355 run : |
5456 Write-Host "$(pwsh --version) is installed at $PSHOME"
5557 psql --version
5658 Write-Host "Active .NET SDK: $(dotnet --version)"
5759 - name : Git checkout
58- uses : actions/checkout@v4
60+ uses : actions/checkout@v6
61+ with :
62+ persist-credentials : false
5963 - name : Restore tools
6064 run : dotnet tool restore
6165 - name : Restore packages
8589 # Get the version suffix from the auto-incrementing build number. For example: '123' => 'master-00123'
8690 $revision = "{0:D5}" -f [convert]::ToInt32($env:GITHUB_RUN_NUMBER, 10)
8791 $branchName = ![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME
88- $safeName = $branchName. Replace('/ ', '-').Replace('_', '-')
89- $versionSuffix = "$safeName -$revision"
92+ $safeBranchName = $($ branchName - Replace '[^a-zA-Z0-9-] ', '-')[0..40] -Join ""
93+ $versionSuffix = "$safeBranchName -$revision"
9094 }
9195 Write-Output "Using version suffix: $versionSuffix"
9296 Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
@@ -100,7 +104,7 @@ jobs:
100104 Logging__LogLevel__Microsoft.Extensions.Hosting.Internal.Host : ' None'
101105 Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command : ' None'
102106 Logging__LogLevel__JsonApiDotNetCore : ' None'
103- run : dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true "
107+ run : dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;annotations-title=@test (@framework);annotations-message=@error\n@trace; summary-include-passed=false "
104108 - name : Upload coverage to codecov.io
105109 if : ${{ matrix.os == 'ubuntu-latest' }}
106110 env :
@@ -113,7 +117,7 @@ jobs:
113117 run : dotnet pack --no-build --configuration Release --output ${{ github.workspace }}/artifacts/packages /p:VersionSuffix=${{ env.PACKAGE_VERSION_SUFFIX }}
114118 - name : Upload packages to artifacts
115119 if : ${{ matrix.os == 'ubuntu-latest' }}
116- uses : actions/upload-artifact@v4
120+ uses : actions/upload-artifact@v5
117121 with :
118122 name : packages
119123 path : artifacts/packages
@@ -123,20 +127,22 @@ jobs:
123127 # This contains the git tag name on release; in that case, we build the docs without publishing them.
124128 DOCFX_SOURCE_BRANCH_NAME : ${{ github.base_ref || github.ref_name }}
125129 run : |
130+ $ErrorActionPreference = "Stop"
131+ $PSNativeCommandUseErrorActionPreference = $true
126132 cd docs
133+ $zipFile = [IO.Path]::Combine($env:TEMP, 'docfx-net10-binaries.zip')
134+ Invoke-WebRequest -Uri 'https://github.com/json-api-dotnet/docfx/raw/refs/heads/dotnet10-rtm/net10-binaries.zip' -Method 'GET' -OutFile $zipFile
135+ Expand-Archive $zipFile -Force
127136 & ./generate-examples.ps1
128- dotnet docfx docfx.json --warningsAsErrors true
129- if ($LastExitCode -ne 0) {
130- Write-Error "docfx failed with exit code $LastExitCode."
131- }
137+ dotnet exec docfx-net10-binaries/docfx.dll docfx.json --warningsAsErrors true
132138 Copy-Item CNAME _site/CNAME
133139 Copy-Item home/*.html _site/
134140 Copy-Item home/*.ico _site/
135141 New-Item -Force _site/styles -ItemType Directory | Out-Null
136142 Copy-Item -Recurse home/assets/* _site/styles/
137143 - name : Upload documentation to artifacts
138144 if : ${{ matrix.os == 'ubuntu-latest' }}
139- uses : actions/upload-artifact@v4
145+ uses : actions/upload-artifact@v5
140146 with :
141147 name : documentation
142148 path : docs/_site
@@ -154,21 +160,30 @@ jobs:
154160 - name : Tune GitHub-hosted runner network
155161 uses : smorimoto/tune-github-hosted-runner-network@v1
156162 - name : Setup .NET
157- uses : actions/setup-dotnet@v4
163+ uses : actions/setup-dotnet@v5
158164 with :
159165 dotnet-version : |
160166 8.0.*
161167 9.0.*
168+ 10.0.*
162169 - name : Git checkout
163- uses : actions/checkout@v4
170+ uses : actions/checkout@v6
171+ with :
172+ persist-credentials : false
164173 - name : Restore tools
165174 run : dotnet tool restore
166175 - name : InspectCode
167176 shell : pwsh
168177 run : |
169178 $inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
170179 Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
171- dotnet jb inspectcode JsonApiDotNetCore.sln --build --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --properties:RunAnalyzers=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
180+ dotnet jb inspectcode --version
181+ dotnet jb inspectcode $env:SOLUTION_FILE --build --no-updates --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --settings=WarningSeverities.DotSettings --properties:"Configuration=Release;RunAnalyzers=false;NuGetAudit=false;ContinuousIntegrationBuild=false" --severity=WARNING --verbosity=WARN --disable-settings-layers="GlobalAll;GlobalPerProduct;SolutionPersonal;ProjectPersonal"
182+ - name : Upload output to artifacts
183+ uses : actions/upload-artifact@v5
184+ with :
185+ name : InspectCode-${{ matrix.os }}
186+ path : ${{ env.INSPECT_CODE_OUTPUT_PATH }}
172187 - name : Verify outcome
173188 shell : pwsh
174189 run : |
@@ -184,7 +199,7 @@ jobs:
184199 $issueType = $xml.report.IssueTypes.SelectSingleNode("IssueType[@Id='$($_.TypeId)']")
185200 $severity = $_.Severity ?? $issueType.Severity
186201
187- Write-Output "[$severity] $($_.File):$($_.Line) $($_.TypeId): $($_.Message)"
202+ Write-Output "[$severity] ($($_.TargetFramework)) $($_.File):$($_.Line) $($_.TypeId): $($_.Message)"
188203 })
189204 })
190205 }
@@ -196,7 +211,7 @@ jobs:
196211 }
197212
198213 cleanup-code :
199- timeout-minutes : 60
214+ timeout-minutes : 90
200215 strategy :
201216 fail-fast : false
202217 matrix :
@@ -208,19 +223,23 @@ jobs:
208223 - name : Tune GitHub-hosted runner network
209224 uses : smorimoto/tune-github-hosted-runner-network@v1
210225 - name : Setup .NET
211- uses : actions/setup-dotnet@v4
226+ uses : actions/setup-dotnet@v5
212227 with :
213228 dotnet-version : |
214229 8.0.*
215230 9.0.*
231+ 10.0.*
216232 - name : Git checkout
217- uses : actions/checkout@v4
233+ uses : actions/checkout@v6
218234 with :
235+ persist-credentials : false
219236 fetch-depth : 2
220237 - name : Restore tools
221238 run : dotnet tool restore
222239 - name : Restore packages
223- run : dotnet restore
240+ run : dotnet restore /p:NuGetAudit=false
241+ - name : Build
242+ run : dotnet build --no-restore --configuration Release /p:RunAnalyzers=false
224243 - name : CleanupCode (on PR diff)
225244 if : ${{ github.event_name == 'pull_request' }}
226245 shell : pwsh
@@ -231,13 +250,15 @@ jobs:
231250 $baseCommitHash = git rev-parse HEAD~1
232251
233252 Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
234- dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
253+ dotnet jb cleanupcode --version
254+ dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:"Configuration=Release;RunAnalyzers=false;NuGetAudit=false" --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
235255 - name : CleanupCode (on branch)
236- if : ${{ github.event_name == 'push' || github.event_name == 'release' }}
256+ if : ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
237257 shell : pwsh
238258 run : |
239259 Write-Output 'Running code cleanup on all files.'
240- dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN --fail-on-diff --print-diff
260+ dotnet jb cleanupcode --version
261+ dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:"Configuration=Release;RunAnalyzers=false;NuGetAudit=false" --jb --verbosity=WARN --fail-on-diff --print-diff
241262
242263 publish :
243264 timeout-minutes : 60
@@ -256,12 +277,12 @@ jobs:
256277 if : ${{ github.event_name == 'push' || github.event_name == 'release' }}
257278 run : |
258279 dotnet nuget add source --username 'json-api-dotnet' --password '${{ secrets.GITHUB_TOKEN }}' --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
259- dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'github'
280+ dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.GITHUB_TOKEN }}' --source 'github' --skip-duplicate
260281 - name : Publish to feedz.io
261282 if : ${{ github.event_name == 'push' || github.event_name == 'release' }}
262283 run : |
263284 dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
264- dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io'
285+ dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io' --skip-duplicate
265286 - name : Publish documentation
266287 if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
267288 uses : peaceiris/actions-gh-pages@v4
0 commit comments