Skip to content

Commit

Permalink
Move C# doc Github Action to Windows (#22880)
Browse files Browse the repository at this point in the history
### Description
Move C# doc Github Action to Windows machines, to avoid having
dependency on Mono which I think is getting deprecated.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
snnn authored Nov 19, 2024
1 parent 497b06f commit a0d36a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/publish-csharp-apidocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ permissions:

jobs:
build:
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Ubuntu2204-AMD-CPU"]
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"]
env:
DOCFXVERSION: 2.62.2
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install DocFX
run: |
dotnet tool update -g docfx
- name: Update PATH
run: |
Add-Content -Value "$env:USERPROFILE\.dotnet\tools" -Encoding utf8 -Path $env:GITHUB_PATH
# NOTE: We need to restore Microsoft.ML.OnnxRuntime.csproj manually to set IncludeMobileTargets=false
# docfx doesn't seem to be able to do that properly resulting in build errors
- name: Restore dependencies
Expand All @@ -50,10 +49,12 @@ jobs:
- name: Log source commit
run: git rev-parse --short HEAD > csharp/ApiDocs/csharp/source-version.txt
- name: Move C# docs into site
shell: pwsh
run: |
mkdir -p _site/docs/api
rm -rf _site/docs/api/csharp
mv csharp/ApiDocs/csharp _site/docs/api/csharp
New-Item -Path _site/docs/api -Force -ItemType "Directory" | Out-Null
$OutputDirectory="_site/docs/api/csharp"
if (Test-Path $OutputDirectory) { Remove-Item -Recurse -Force $OutputDirectory }
Move-Item -Path csharp\ApiDocs\csharp -Destination $OutputDirectory
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion csharp/ApiDocs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"disableDefaultFilter": false,
"noRestore": true,
"properties": {
"AllowUnsafeBlocks": true,
"AllowUnsafeBlocks": "true",
"TargetFramework": "net8.0",
"Nullable": "enable",
"LangVersion": "8.0",
Expand Down

0 comments on commit a0d36a5

Please sign in to comment.