-
Notifications
You must be signed in to change notification settings - Fork 2.9k
58 lines (54 loc) · 1.61 KB
/
publish-csharp-apidocs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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: ubuntu-latest
env:
DOCFXVERSION: 2.62.2
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore csharp/ApiDocs/ApiDocs.csproj
- name: Download DocFX
run: |
mkdir -p build/docfx
wget https://github.com/dotnet/docfx/releases/download/v${DOCFXVERSION}/docfx-linux-x64-v${DOCFXVERSION}.zip -O build/docfx/docfx.zip
unzip build/docfx/docfx.zip -d build/docfx
- 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 -p _site/docs/api
rm -rf _site/docs/api/csharp
mv csharp/ApiDocs/csharp _site/docs/api/csharp
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: onnxruntime-csharp-apidocs
path: _site
retention-days: 60