Skip to content

Commit

Permalink
Android (arm64) 向けビルドの追加 (VOICEVOX#444)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryo Yamashita <[email protected]>
  • Loading branch information
char5742 and qryxip authored Mar 22, 2023
1 parent 07ac7e7 commit f4d3065
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ ORT_OUT_DIR = { value = "target/debug/deps", relative = true }

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.aarch64-linux-android]
linker = "aarch64-linux-android29-clang"
21 changes: 19 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
artifact_name: linux-arm64-cpu
whl_local_version: cpu
use_cuda: false
- os: ubuntu-20.04
features: ""
target: aarch64-linux-android
artifact_name: linux-arm64-cpu
use_cuda: false
- os: macos-11
features: ""
target: aarch64-apple-darwin
Expand All @@ -88,6 +93,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
if: matrix.whl_local_version
uses: actions/setup-python@v4
with:
python-version: "3.8"
Expand All @@ -102,6 +108,16 @@ jobs:
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- uses: nttld/setup-ndk@v1
if: matrix.target == 'aarch64-linux-android'
with:
ndk-version: r25b
- name: Set path for android
if: matrix.target == 'aarch64-linux-android'
shell: bash
run: |
echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> "$GITHUB_PATH"
echo "AR_aarch64_linux_android=llvm-ar" >> "$GITHUB_ENV"
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cbindgen
Expand All @@ -115,7 +131,7 @@ jobs:
shell: bash
run: |
cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude download --exclude xtask
cargo set-version "$VERSION+"${{ matrix.whl_local_version }} -p voicevox_core_python_api
if ${{ matrix.whl_local_version }}; then cargo set-version "$VERSION+"${{ matrix.whl_local_version }} -p voicevox_core_python_api; fi
- name: generate voicevox_core.h
shell: bash
run: cbindgen --crate voicevox_core_c_api -o ./voicevox_core.h
Expand All @@ -124,6 +140,7 @@ jobs:
env:
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_python_api
if: matrix.whl_local_version
id: build-voicevox-core-python-api
shell: bash
run: |
Expand Down Expand Up @@ -171,7 +188,7 @@ jobs:
${{ env.ASSET_NAME }}.zip
target_commitish: ${{ github.sha }}
- name: Upload Python whl to Release
if: env.VERSION != 'DEBUG' && env.SKIP_UPLOADING_RELEASE_ASSET == '0'
if: env.VERSION != 'DEBUG' && env.SKIP_UPLOADING_RELEASE_ASSET == '0' && matrix.whl_local_version
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand Down
11 changes: 5 additions & 6 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ derive-new = "0.5.9"
easy-ext.workspace = true
fs-err.workspace = true
once_cell.workspace = true
onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", rev="405f62fb53df1b59b0e69adafbd1c28e4d5c2787" }
process_path = "0.1.4"
onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", rev="09dc0c764e6f1d5c4bdcb8a96cfc3c41789e66bc" }
# FIXME: 最新のコミットでのみAndroidのビルドが通るため
process_path = {git = "https://github.com/wesleywiser/process_path.git", rev = "ff028326505f7198ce528feecead9a367a43adc4" }
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tracing.workspace = true
open_jtalk = { git = "https://github.com/VOICEVOX/open_jtalk-rs.git", rev="9edab53f0bfa877dbb37224d17fd0f3efbe32abd" }
open_jtalk = { git = "https://github.com/VOICEVOX/open_jtalk-rs.git", rev="aa50be1c372a4733e9b5eed79902af1d4b3f155a" }
regex = "1.6.0"

[dev-dependencies]
Expand Down

0 comments on commit f4d3065

Please sign in to comment.