Skip to content

Commit

Permalink
Merge branch 'main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jun 12, 2023
2 parents dfbb533 + b8c1b31 commit 686567f
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 103 deletions.
23 changes: 0 additions & 23 deletions .github/actions/cargo-binstall-cbindgen/action.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
- name: build voicevox_core_c_api
run: cargo build -p voicevox_core_c_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
env:
RUSTFLAGS: -C panic=abort
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_python_api
if: matrix.whl_local_version
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ jobs:
if: ${{ env.EXPECTED_VOICEVOX_CORE_VERSION == 'latest' }}
shell: bash
run: |
echo "EXPECTED_VOICEVOX_CORE_VERSION=$(curl -sSfI "https://github.com/VOICEVOX/voicevox_core/releases/latest"| grep "location:" | sed -e "s%location: https://github.com/VOICEVOX/voicevox_core/releases/tag/%%" | sed 's/\r//g')" >> "$GITHUB_ENV"
echo "EXPECTED_VOICEVOX_CORE_VERSION=$(gh release view --repo VOICEVOX/voicevox_core --json 'tagName' --jq '.tagName')" >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Check downloaded version
shell: bash
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/generate_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ jobs:
python-version: "3.8"
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cbindgen
uses: ./.github/actions/cargo-binstall-cbindgen
- name: Create a venv
uses: ./.github/actions/create-venv
- name: pip install
run: pip install -r ./crates/voicevox_core_python_api/requirements.txt
- name: Generate C header file
run: cbindgen --crate voicevox_core_c_api -o ./docs/apis/c_api/doxygen/voicevox_core.h
- 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:
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,27 @@ jobs:
uses: ./.github/actions/rust-toolchain-from-file
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cbindgen
uses: ./.github/actions/cargo-binstall-cbindgen
- name: Extract the version of cbindgen that xtask depends on
id: cbindgen-version
run: |
metadata=$(cargo metadata --format-version 1)
version=$(
jq -r '
(.workspace_members[] | select(startswith("xtask "))) as $xtask
| (.resolve.nodes[] | select(.id == $xtask).deps[] | select(.name == "cbindgen").pkg) as $cbindgen
| .packages[] | select(.id == $cbindgen).version
' <<< "$metadata"
)
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Install cbindgen v${{ steps.cbindgen-version.outputs.version }}
run: |
cargo binstall \
cbindgen@${{ steps.cbindgen-version.outputs.version }} \
--pkg-url 'https://github.com/alsuren/cargo-quickinstall/releases/download/{ name }-{ version }-{ target }/{ name }-{ version }-{ target }.tar.gz' \
--pkg-fmt tgz \
--bin-dir '{ bin }{ binary-ext }' \
--no-confirm \
--log-level debug
- name: Assert voicevox_core.h is up to date
run: |
cbindgen --crate voicevox_core_c_api -o /tmp/voicevox_core.h
Expand All @@ -140,15 +159,12 @@ jobs:
uses: ./.github/actions/rust-toolchain-from-file
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cbindgen
uses: ./.github/actions/cargo-binstall-cbindgen
- name: build voicevox_core_c_api
run: cargo build -p voicevox_core_c_api -vv
- name: voicevox_core.hを生成
run: cbindgen --crate voicevox_core_c_api -o ./example/cpp/unix/voicevox_core/voicevox_core.h
- name: 必要なfileをunix用exampleのディレクトリに移動させる
run: |
mkdir -p example/cpp/unix/voicevox_core/
cp -v crates/voicevox_core_c_api/include/voicevox_core.h example/cpp/unix/voicevox_core/
cp -v target/debug/libvoicevox_core.{so,dylib} example/cpp/unix/voicevox_core/ || true
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.so.* example/cpp/unix/voicevox_core/ || true
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.*.dylib example/cpp/unix/voicevox_core/ || true
Expand Down Expand Up @@ -184,15 +200,12 @@ jobs:
uses: ./.github/actions/rust-toolchain-from-file
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cbindgen
uses: ./.github/actions/cargo-binstall-cbindgen
- name: build voicevox_core_c_api
run: cargo build -p voicevox_core_c_api -vv
- name: voicevox_core.hを生成
run: cbindgen --crate voicevox_core_c_api -o ./example/cpp/windows/simple_tts/voicevox_core.h
- name: 必要なfileをexampleのディレクトリに移動させる
run: |
mkdir example/cpp/windows/simple_tts/lib/x64
cp -v crates/voicevox_core_c_api/include/voicevox_core.h example/cpp/windows/simple_tts/
cp target/debug/voicevox_core.dll.lib example/cpp/windows/simple_tts/lib/x64/voicevox_core.lib
- name: Add MSBuild to PATH
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
[workspace]
members = [
"crates/download",
"crates/test_util",
"crates/voicevox_core",
"crates/voicevox_core_c_api",
"crates/voicevox_core_python_api",
"crates/xtask",
"crates/download",
"crates/test_util",
"crates/voicevox_core",
"crates/voicevox_core_c_api",
"crates/voicevox_core_python_api",
"crates/xtask"
]

[workspace.package]
version = "0.0.0"
edition = "2021"
publish = false

[workspace.dependencies]
anyhow = "1.0.65"
async_zip = { version = "0.0.11", features = ["full"] }
Expand All @@ -21,8 +16,6 @@ const-default = { version = "1.0.0", features = ["derive"] }
easy-ext = "1.0.1"
fs-err = { version = "2.9.0", features = ["tokio"] }
once_cell = "1.15.0"
# FIXME: iOS対応のpull request(https://github.com/wesleywiser/process_path/pull/16)がマージされる見込みが無いため
process_path = { git = "https://github.com/VOICEVOX/process_path.git", rev = "de226a26e8e18edbdb1d6f986afe37bbbf35fbf4" }
regex = "1.6.0"
serde = { version = "1.0.145", features = ["derive"] }
serde_json = { version = "1.0.85", features = ["preserve_order"] }
Expand All @@ -35,11 +28,20 @@ voicevox_core = { path = "crates/voicevox_core" }
tokio = { version = "1.25.0", features = ["rt", "rt-multi-thread", "macros", "sync"] }
derive-getters = "0.2.0"

# FIXME: iOS対応のpull request(https://github.com/wesleywiser/process_path/pull/16)がマージされる見込みが無いため
[workspace.dependencies.process_path]
git = "https://github.com/VOICEVOX/process_path.git"
rev = "de226a26e8e18edbdb1d6f986afe37bbbf35fbf4"

[workspace.package]
version = "0.0.0"
edition = "2021"
publish = false

# min-sized-rustを元にrelease buildのサイズが小さくなるようにした
# https://github.com/johnthagen/min-sized-rust
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ typos
**[VOICEVOX ENGINE SHARP](https://github.com/yamachu/VoicevoxEngineSharp) [@yamachu](https://github.com/yamachu)** ・・・ VOICEVOX ENGINE の C# 実装
**[voicevoxcore4s](https://github.com/windymelt/voicevoxcore4s) [@windymelt](https://github.com/windymelt)** ・・・ VOICEVOX CORE の Scala(JVM) 向け FFI ラッパー
**[voicevox_flutter](https://github.com/char5742/voicevox_flutter) [@char5742](https://github.com/char5742)** ・・・ VOICEVOX CORE の Flutter 向け FFI ラッパー
**[voicevoxcore.go](https://github.com/sh1ma/voicevoxcore.go) [@sh1ma](https://github.com/sh1ma)** ・・・ VOICEVOX CORE の Go 言語 向け FFI ラッパー
## ライセンス

ソースコードのライセンスは [MIT LICENSE](./LICENSE) です。
Expand Down
27 changes: 16 additions & 11 deletions crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,42 @@ publish.workspace = true
default = []
directml = ["onnxruntime/directml"]


[dependencies]
anyhow.workspace = true
async_zip.workspace = true
cfg-if = "1.0.0"
const-default.workspace = true
derive-getters.workspace = true
derive-new = "0.5.9"
duplicate = "1.0.0"
easy-ext.workspace = true
fs-err.workspace = true
futures = "0.3.26"
nanoid = "0.4.0"
once_cell.workspace = true
onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", rev="ebb9dcb9b26ee681889b52b6db3b4f642b04a250" }
process_path.workspace = true
regex.workspace = true
serde.workspace = true
serde_json.workspace = true
strum.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
open_jtalk = { git = "https://github.com/VOICEVOX/open_jtalk-rs.git", rev="d766a52bad4ccafe18597e57bd6842f59dca881e" }
regex.workspace = true
async_zip.workspace = true
futures = "0.3.26"
nanoid = "0.4.0"
tokio.workspace = true

[dependencies.onnxruntime]
git = "https://github.com/VOICEVOX/onnxruntime-rs.git"
rev = "ebb9dcb9b26ee681889b52b6db3b4f642b04a250"

[dependencies.open_jtalk]
git = "https://github.com/VOICEVOX/open_jtalk-rs.git"
rev = "d766a52bad4ccafe18597e57bd6842f59dca881e"

[dev-dependencies]
rstest = "0.15.0"
pretty_assertions = "1.3.0"
flate2 = "1.0.24"
tar = "0.4.38"
heck = "0.4.0"
pretty_assertions = "1.3.0"
rstest = "0.15.0"
tar = "0.4.38"
test_util.workspace = true

[target."cfg(windows)".dependencies]
Expand Down
2 changes: 0 additions & 2 deletions crates/voicevox_core/build.rs

This file was deleted.

23 changes: 13 additions & 10 deletions crates/voicevox_core_c_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,49 @@ edition.workspace = true
publish.workspace = true

[lib]
name = "voicevox_core"
crate-type = ["cdylib"]
name = "voicevox_core"

[[test]]
name = "e2e"
harness = false
name = "e2e"

[features]
directml = ["voicevox_core/directml"]

[dependencies]
voicevox_core.workspace = true
chrono = { version = "0.4.23", default-features = false, features = ["clock"] } # https://github.com/chronotope/chrono/issues/602
const-default.workspace = true
is-terminal = "0.4.2"
derive-getters.workspace = true
libc = "0.2.134"
once_cell.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tracing-subscriber.workspace = true
tokio.workspace = true
derive-getters.workspace = true
tracing-subscriber.workspace = true
voicevox_core.workspace = true

[dependencies.chrono]
version = "0.4.23"
default-features = false
features = ["clock"]

[dev-dependencies]
pretty_assertions = "1.3.0"
anyhow.workspace = true
rstest = "0.15.0"
assert_cmd = { version = "2.0.8", features = ["color-auto"] }
clap.workspace = true
duct = "0.13.6"
easy-ext.workspace = true
inventory = "0.3.4"
libloading = "0.7.3"
libtest-mimic = "0.6.0"
ndarray = "0.15.6"
ndarray-stats = "0.5.1"
pretty_assertions = "1.3.0"
process_path.workspace = true
regex.workspace = true
rstest = "0.15.0"
serde.workspace = true
strum.workspace = true
test_util.workspace = true
toml = "0.7.2"
typetag = "0.2.5"
inventory = "0.3.4"
Loading

0 comments on commit 686567f

Please sign in to comment.