From d52d3c00520a10075e3bc75fe90db5b4c83ee557 Mon Sep 17 00:00:00 2001 From: "Nat Kershaw (MSFT)" Date: Fri, 7 Jan 2022 16:16:47 -0800 Subject: [PATCH] Update C/C++ API docs automation to create a PR (instead of push to publish branch) (#10093) --- .github/workflows/publish-c-apidocs.yml | 29 ++++++++++++++----- docs/c_cxx/README.md | 16 ++++------ .../core/session/onnxruntime_c_api.h | 4 +-- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish-c-apidocs.yml b/.github/workflows/publish-c-apidocs.yml index db2f88dbc3..12e3e9760a 100644 --- a/.github/workflows/publish-c-apidocs.yml +++ b/.github/workflows/publish-c-apidocs.yml @@ -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 @@ -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: - BRANCH: gh-pages - FOLDER: build/doxygen/html - TARGET_FOLDER: docs/api/c - CLEAN_EXCLUDE: '["_config.yml"]' + 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-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 + \ No newline at end of file diff --git a/docs/c_cxx/README.md b/docs/c_cxx/README.md index 24b11e4f72..960c5f3e47 100644 --- a/docs/c_cxx/README.md +++ b/docs/c_cxx/README.md @@ -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. \ No newline at end of file diff --git a/include/onnxruntime/core/session/onnxruntime_c_api.h b/include/onnxruntime/core/session/onnxruntime_c_api.h index 92f27b685a..31b0442775 100644 --- a/include/onnxruntime/core/session/onnxruntime_c_api.h +++ b/include/onnxruntime/core/session/onnxruntime_c_api.h @@ -7,11 +7,11 @@ * *

C

* -* ::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. * *

C++

* -* ::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.