Skip to content

Commit 5efdcf3

Browse files
committed
Add temporary workaround until docfx version is available that is compatible with .NET 10
1 parent ad02dd4 commit 5efdcf3

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+
docfx-net10-binaries/docfx 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 $zipFile)) {
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."
@@ -40,6 +50,7 @@ function EnsureHttpServerIsInstalled {
4050
}
4151
}
4252

53+
EnsureDocfxBinaries
4354
EnsureHttpServerIsInstalled
4455

4556
if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
@@ -53,7 +64,7 @@ if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
5364
dotnet tool restore
5465

5566
$env:DOCFX_SOURCE_BRANCH_NAME="dev"
56-
dotnet docfx docfx.json --warningsAsErrors true
67+
docfx-net10-binaries/docfx docfx.json --warningsAsErrors true
5768

5869
Copy-Item -Force home/*.html _site/
5970
Copy-Item -Force home/*.ico _site/

0 commit comments

Comments
 (0)