Generate Docs #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Docs | |
on: workflow_dispatch | |
jobs: | |
build-python-package: | |
runs-on: kuzu-self-hosted-linux-building-x86_64 | |
env: | |
PLATFORM: manylinux_2_28_x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Python package | |
working-directory: scripts/pip-package/ | |
run: | | |
mkdir wheelhouse | |
/opt/python/cp310-cp310/bin/python package_tar.py kuzu.tar.gz | |
/opt/python/cp310-cp310/bin/pip wheel kuzu.tar.gz --no-deps -w wheelhouse/ | |
auditwheel repair wheelhouse/kuzu-*.whl -w wheelhouse/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-python-package | |
path: scripts/pip-package/wheelhouse/*.manylinux_2_28_x86_64.whl | |
generate-python-docs: | |
runs-on: ubuntu-latest | |
needs: build-python-package | |
container: | |
image: python:3.10-bullseye | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Python package | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-python-package | |
- name: Install Python packages | |
run: | | |
pip install *.whl | |
pip install pdoc | |
pip install torch~=2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu | |
pip install -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.0.0+cpu.html | |
- name: Generate Python docs | |
run: | | |
mkdir docs | |
pdoc --docformat "numpy" -o docs kuzu | |
- name: Upload Python docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-python-docs | |
path: ./docs | |
generate-nodejs-docs: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install Node.js packages | |
run: | | |
npm install -g jsdoc | |
- name: Generate Node.js docs | |
shell: bash | |
run: | | |
jsdoc ./tools/nodejs_api/src_js/*.js ./tools/nodejs_api/README.md --destination ./docs | |
- name: Upload Node.js docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-nodejs-docs | |
path: ./docs | |
generate-wasm-docs: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install Node.js packages | |
run: | | |
npm install -g jsdoc | |
- name: Generate Node.js docs | |
shell: bash | |
run: | | |
mkdir docs | |
jsdoc ./tools/wasm/src_js/sync/*.js ./tools/wasm/src_js/sync/README.md --destination ./docs/sync | |
jsdoc ./tools/wasm/src_js/*.js ./tools/wasm/src_js/README.md --destination ./docs/async | |
- name: Upload Node.js docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-wasm-docs | |
path: ./docs | |
generate-java-docs: | |
runs-on: ubuntu-latest | |
container: | |
image: openjdk:20 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate Java docs | |
shell: bash | |
run: | | |
mkdir docs | |
cd docs && javadoc ../tools/java_api/src/main/java/com/kuzudb/*.java | |
- name: Upload Java docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-java-docs | |
path: ./docs | |
generate-cpp-docs: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Doxygen | |
run: brew install doxygen | |
- name: Generate C and C++ docs | |
shell: bash | |
working-directory: scripts/generate-cpp-docs/ | |
run: | | |
chmod +x doxygen.sh | |
./doxygen.sh | |
- name: Upload C++ docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-cpp-docs | |
path: ./scripts/generate-cpp-docs/cpp/docs/html | |
- name: Upload C docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kuzu-c-docs | |
path: ./scripts/generate-cpp-docs/c/docs/html | |
update-docs: | |
runs-on: ubuntu-22.04 | |
needs: [ | |
generate-python-docs, | |
generate-nodejs-docs, | |
generate-wasm-docs, | |
generate-java-docs, | |
generate-cpp-docs | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: kuzudb/api-docs | |
token: ${{ secrets.DOC_PUSH_TOKEN }} | |
path: api-docs | |
- name: Remove old documentations | |
run: | | |
rm -rf api-docs/python | |
rm -rf api-docs/nodejs | |
rm -rf api-docs/wasm | |
rm -rf api-docs/java | |
rm -rf api-docs/cpp | |
rm -rf api-docs/c | |
- name: Download Python docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-python-docs | |
path: api-docs/python | |
- name: Download Node.js docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-nodejs-docs | |
path: api-docs/nodejs | |
- name: Download WASM docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-wasm-docs | |
path: api-docs/wasm | |
- name: Download Java docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-java-docs | |
path: api-docs/java | |
- name: Download C++ docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-cpp-docs | |
path: api-docs/cpp | |
- name: Download C docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: kuzu-c-docs | |
path: api-docs/c | |
- name: Push changes | |
working-directory: api-docs | |
run: | | |
git checkout -b "api-documentation-update-${{ github.sha }}" | |
git config --global user.name "CI User" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "Update API documentations" | |
git push -u origin "api-documentation-update-${{ github.sha }}" | |
- name: Create pull request | |
working-directory: api-docs | |
run: | | |
echo "${{ secrets.DOC_PUSH_TOKEN }}" > token.txt | |
gh auth login --with-token < token.txt | |
rm -rf token.txt | |
gh pr create \ | |
--body "Action triggered by CI workflow." \ | |
--title "Update API documentations" \ | |
--head "api-documentation-update-${{ github.sha }}" \ | |
--base "main" |