mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
### Description <!-- Describe your changes. --> ### Motivation and Context 1. Python API doc needs to be merged from a fork, but 1ES self-hosted pool is only for one github repo. 2. ubuntu-latest will be install numpy above 2.0 by default, and current python API doc generation doesn't support it. So I pin numpy < 2.0.0 ---------
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: Update Python API Docs
|
|
|
|
# Run when the Python API changes or every month so that the artifact does not expire
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- onnxruntime/python/**
|
|
- docs/python/**
|
|
schedule:
|
|
- cron: '0 0 1 * *'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: "apidocs-python"
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: Generate Python API docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install python3-pip
|
|
sudo apt-get install graphviz
|
|
- name: Install dependencies
|
|
run: |
|
|
python3 -m pip install --upgrade pip
|
|
cd docs/python
|
|
python3 -m pip install -r requirements.txt
|
|
python3 -m pip install --pre onnxruntime-training -f https://download.onnxruntime.ai/onnxruntime_nightly_cpu.html
|
|
python3 -m pip list
|
|
- name: Generate Python docs with Sphinx
|
|
run: |
|
|
cd tools/doc
|
|
./builddoc.sh /usr/bin ../.. ../../build
|
|
- name: Log source commit
|
|
run: git rev-parse --short HEAD > build/docs/html/source-version.txt
|
|
- name: Move Python docs into site
|
|
run: |
|
|
rm -rf _site/docs/api/python
|
|
mkdir -p _site/docs/api/
|
|
mv build/docs/html _site/docs/api/python
|
|
- name: Upload docs artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: onnxruntime-python-apidocs
|
|
path: _site
|
|
retention-days: 60
|