-
Notifications
You must be signed in to change notification settings - Fork 120
81 lines (81 loc) · 2.75 KB
/
generate_document.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: generate API documents
on:
push:
branches:
- main
pull_request:
defaults:
run:
shell: bash
jobs:
generate_api_document:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Create a venv
uses: ./.github/actions/create-venv
- name: Install python dependencies
working-directory: ./crates/voicevox_core_python_api
run: |
pip install --upgrade poetry
poetry config virtualenvs.create false
poetry install --with test
- name: mkdir public
run: mkdir -p public/apis/c_api
- name: cp docs/apis/index.html
run: cp docs/apis/index.html public/apis/
- name: cp crates/voicevox_core_c_api/include/voicevox_core.h
run: cp crates/voicevox_core_c_api/include/voicevox_core.h docs/apis/c_api/doxygen/
- name: Generate doxygen document
uses: mattnotmitt/[email protected]
with:
working-directory: "docs/apis/c_api/doxygen"
- name: Build voicevox_core_python_api
run: |
cargo build -p voicevox_core_c_api -vv
maturin develop --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --locked
# https://github.com/readthedocs/sphinx-autoapi/issues/405
- name: Workaround to make Sphinx recognize `_rust` as a module
run: touch ./crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.py
- name: Generate Sphinx document
run: sphinx-build docs/apis/python_api public/apis/python_api
- name: Generate Javadoc
run: |
(cd crates/voicevox_core_java_api && ./gradlew javadoc)
mkdir -p public/apis/java_api
cp -r crates/voicevox_core_java_api/lib/build/docs/javadoc/* public/apis/java_api
- name: Uplaod api document
uses: actions/upload-pages-artifact@v1
if: ${{ github.ref_name == 'main' }}
with:
path: public
deploy_api_github_pages:
runs-on: ubuntu-latest
needs:
- generate_api_document
permissions:
pages: write
id-token: write
environment:
name: APIドキュメント
url: ${{ steps.api.outputs.page_url }}/apis
if: ${{ github.ref_name == 'main' }}
steps:
- name: Deploy to GitHub pages
id: api
uses: actions/deploy-pages@v1