Skip to content

Commit

Permalink
Update C/C++ API docs automation to create a PR (instead of push to p…
Browse files Browse the repository at this point in the history
…ublish branch) (#10093)
  • Loading branch information
natke committed Jan 8, 2022
1 parent 5ebb857 commit d52d3c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/publish-c-apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Publish C/C++ API Docs
name: Update C/C++ API Docs
on:
workflow_dispatch

jobs:
publish:
name: Publish C/C++ API docs
name: Generate C/C++ API docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -15,16 +15,29 @@ jobs:
sudo apt-get install libclang-cpp9
wget https://www.doxygen.nl/files/doxygen-1.9.2.linux.bin.tar.gz
tar xvzf doxygen-1.9.2.linux.bin.tar.gz
- name: Set commit ID
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Run doxygen
run: |
mkdir -p build/doxygen
cd docs/c_cxx
../../doxygen-1.9.2/bin/doxygen
- name: Publish
uses: JamesIves/github-pages-deploy-action@releases/v3
- uses: actions/checkout@v2
with:
ref: gh-pages
clean: false
- name: Move API docs into target area
run: |
rm -rf docs/api/c
mv build/doxygen/html docs/api/c
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
BRANCH: gh-pages
FOLDER: build/doxygen/html
TARGET_FOLDER: docs/api/c
CLEAN_EXCLUDE: '["_config.yml"]'
branch: gh-pages-pr
base: gh-pages
title: '[Automated]: Update C/C++ API docs'
commit-message: 'Update C/C++ API docs to commit ${{ steps.vars.outputs.sha_short }}'
add-paths: docs/api/c


16 changes: 5 additions & 11 deletions docs/c_cxx/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
How to build the Doxygen HTML pages on Windows:
# ONNX Runtime C/C++ docs source files

* Install Doxygen (https://www.doxygen.nl/download.html)
* Running from the command line:
* cd to (Repository Root)\docs\c_cxx
* Run "\Program Files\doxygen\bin\doxygen.exe" Doxyfile
* Using the Doxygen GUI app:
* Launch Doxygen GUI (Doxywizard)
* File->Open (Repository Root)\docs\c_cxx\Doxyfile
* Switch to Run tab, click 'Run doxygen'
* Generated docs are written to (Repository Root)\build\doxygen\html
This directory contains doxygen configuration to generate the C/C++ API docs for ONNX Runtime.

The generated documentation is online in the gh-pages branch of the project: https://github.com/microsoft/onnxruntime/tree/gh-pages/docs/api/c
The actual generation is performed by a GitHub actions workflow: [publish-c-apidocs.yml](../../.github/workflows/publish-c-apidocs.yml).

The workflow is currently manually triggered, and generates a PR to the gh-pages branch, for publication on https://onnxruntime.ai.
4 changes: 2 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*
* <h1>C</h1>
*
* ::OrtApi - Click here to jump to the structure with all C API functions.
* ::OrtApi - Click here to go to the structure with all C API functions.
*
* <h1>C++</h1>
*
* ::Ort - Click here to jump to the namespace holding all of the C++ wrapper classes
* ::Ort - Click here to go to the namespace holding all of the C++ wrapper classes
*
* It is a set of header only wrapper classes around the C API. The goal is to turn the C style return value error codes into C++ exceptions, and to
* automate memory management through standard C++ RAII principles.
Expand Down

0 comments on commit d52d3c0

Please sign in to comment.