mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-21 19:18:55 +00:00
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
name: Update C# API Docs
|
|
|
|
# Run when the C# API changes or every month so that the artifact does not expire
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- csharp/**
|
|
schedule:
|
|
- cron: '0 0 1 * *'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "apidocs-csharp"
|
|
cancel-in-progress: false
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: 6.0.x
|
|
- name: Restore dependencies
|
|
run: dotnet restore csharp/ApiDocs/ApiDocs.csproj
|
|
- name: Download DocFX
|
|
run: |
|
|
mkdir -p build\docfx
|
|
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v${env:DOCFXVERSION}/docfx-win-x64-v${env:DOCFXVERSION}.zip" -OutFile "build/docfx/docfx.zip"
|
|
[System.IO.Compression.ZipFile]::ExtractToDirectory("build/docfx/docfx.zip", "build/docfx" )
|
|
env:
|
|
DOCFXVERSION: 2.67.0
|
|
- name: Install NuGet
|
|
uses: nuget/setup-nuget@v1
|
|
- name: Build Documentation
|
|
run: |
|
|
build\docfx\docfx metadata csharp\ApiDocs\docfx.json
|
|
dotnet build csharp\ApiDocs\ApiDocs.csproj --no-restore
|
|
build\docfx\docfx build csharp\ApiDocs\docfx.json
|
|
- name: Log source commit
|
|
run: git rev-parse --short HEAD > csharp/ApiDocs/csharp/source-version.txt
|
|
- name: Move C# docs into site
|
|
run: |
|
|
mkdir _site\docs\api
|
|
if (Test-Path _site\docs\api\csharp) {
|
|
Remove-Item -Recurse -Force _site\docs\api\csharp
|
|
}
|
|
move csharp\ApiDocs\csharp _site\docs\api
|
|
- name: Upload docs artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: onnxruntime-csharp-apidocs
|
|
path: _site
|
|
retention-days: 60
|