Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Rust APIのAPIドキュメントをデプロイするようにする #803

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/generate_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ jobs:
submodules: true
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Extract the Rust version used on Docs.rs
id: docsrs-rust-version
run: |
page=$(curl -f https://docs.rs/about/builds)
date=$(
sed -n \
's:^.*<code>rustc 1\.[0-9]\+\.[0-9]\+-nightly ([0-9a-f]\{9\} \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\))</code>.*$:\1:p' \
<<< "$page"
)
echo "rust-toolchain=nightly-$date" >> "$GITHUB_OUTPUT"
- name: Set up nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.docsrs-rust-version.outputs.rust-toolchain }}
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -25,8 +39,8 @@ jobs:
with:
java-version: "11"
distribution: "adopt"
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-docs-rs
uses: dtolnay/install@cargo-docs-rs
- name: Create a venv
uses: ./.github/actions/create-venv
- name: Install python dependencies
Expand All @@ -39,6 +53,10 @@ jobs:
run: mkdir -p public/apis/c_api
- name: cp docs/apis/index.html
run: cp docs/apis/index.html public/apis/
- name: Generate rustdoc
run: |
cargo +${{ steps.docsrs-rust-version.outputs.rust-toolchain }} docs-rs -p voicevox_core
mv target/x86_64-unknown-linux-gnu/doc public/apis/rust_api
- 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
Expand Down
1 change: 1 addition & 0 deletions docs/apis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<body>
<!-- TODO: まともなページを用意する -->
<ul>
<li><a href="./rust_api/voicevox_core">Rust API</a></li>
<li><a href="./c_api">C API</a></li>
<li><a href="./python_api">Python API</a></li>
<li><a href="./java_api">Java API</a></li>
Expand Down
Loading