Skip to content

Commit d582105

Browse files
committed
Add temporary workaround until docfx version is available that is compatible with .NET 10
1 parent 66910f1 commit d582105

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,11 @@ jobs:
128128
$ErrorActionPreference = "Stop"
129129
$PSNativeCommandUseErrorActionPreference = $true
130130
cd docs
131+
$zipFile = [IO.Path]::Combine($env:TEMP, 'docfx-net10-binaries.zip')
132+
Invoke-WebRequest -Uri 'https://github.com/json-api-dotnet/docfx/raw/refs/heads/dotnet10-rtm/net10-binaries.zip' -Method 'GET' -OutFile $zipFile
133+
Expand-Archive $zipFile -Force
131134
& ./generate-examples.ps1
132-
dotnet docfx docfx.json --warningsAsErrors true
135+
dotnet exec docfx-net10-binaries/docfx.dll docfx.json --warningsAsErrors true
133136
Copy-Item CNAME _site/CNAME
134137
Copy-Item home/*.html _site/
135138
Copy-Item home/*.ico _site/

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ api/*.yml
33
api/.manifest
44
request-examples/*.json
55
request-examples/*.temp
6+
docfx-net10-binaries/

docs/build-dev.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ $PSNativeCommandUseErrorActionPreference = $true
1515
# Workaround for bug at https://github.com/PowerShell/PowerShell/issues/23875#issuecomment-2672336383
1616
$PSDefaultParameterValues['Remove-Item:ProgressAction'] = 'SilentlyContinue'
1717

18+
function EnsureDocfxBinaries() {
19+
# Temporary workaround until a proper DocFX build supporting .NET 10 is available.
20+
$zipFile = [IO.Path]::Combine($env:TEMP, 'docfx-net10-binaries.zip')
21+
22+
if (!(Test-Path -Path 'docfx-net10-binaries')) {
23+
Invoke-WebRequest -Uri 'https://github.com/json-api-dotnet/docfx/raw/refs/heads/dotnet10-rtm/net10-binaries.zip' -Method 'GET' -OutFile $zipFile
24+
Expand-Archive $zipFile -Force
25+
}
26+
}
27+
1828
function EnsureHttpServerIsInstalled {
1929
if ((Get-Command "npm" -ErrorAction SilentlyContinue) -eq $null) {
2030
throw "Unable to find npm in your PATH. please install Node.js first."
@@ -45,6 +55,7 @@ function EnsureHttpServerIsInstalled {
4555
}
4656
}
4757

58+
EnsureDocfxBinaries
4859
EnsureHttpServerIsInstalled
4960

5061
if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
@@ -58,7 +69,7 @@ if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
5869
dotnet tool restore
5970

6071
$env:DOCFX_SOURCE_BRANCH_NAME="dev"
61-
dotnet docfx docfx.json --warningsAsErrors true
72+
dotnet exec docfx-net10-binaries/docfx.dll -- docfx.json --warningsAsErrors true
6273

6374
Copy-Item -Force home/*.html _site/
6475
Copy-Item -Force home/*.ico _site/

0 commit comments

Comments
 (0)