Skip to content

Commit

Permalink
Merge branch 'VOICEVOX:main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna2134 authored May 22, 2024
2 parents a3a342b + 5a644ca commit c6c7a51
Show file tree
Hide file tree
Showing 109 changed files with 3,680 additions and 3,772 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ xtask = "run -p xtask --"
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }

# Windows環境でテストエラーになるのを防ぐために設定するworkaround
# https://github.com/VOICEVOX/onnxruntime-rs/issues/3#issuecomment-1207381367
ORT_OUT_DIR = { value = "target/debug/deps", relative = true }

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

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/create-venv/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: Create venv
description: Pythonの仮想環境を作成し、$PATHと$VIRTUAL_ENVを設定する。

runs:
using: composite
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/rust-toolchain-from-file/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: rustup toolchain install from file
description: rust-toolchainファイルをもとにRustのツールチェーンをインストールする。

inputs:
targets:
required: false
Expand Down
79 changes: 26 additions & 53 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -67,16 +66,14 @@ jobs:
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-directml",
"whl_local_version": "directml",
"use_cuda": false,
"can_skip_in_simple_test": false
},
{
"os": "windows-2019",
"features": "",
"features": "cuda",
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-cuda",
"whl_local_version": "cuda",
"use_cuda": true,
"can_skip_in_simple_test": true
},
{
Expand All @@ -85,7 +82,6 @@ jobs:
"target": "i686-pc-windows-msvc",
"artifact_name": "windows-x86-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -94,16 +90,14 @@ jobs:
"target": "x86_64-unknown-linux-gnu",
"artifact_name": "linux-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"features": "cuda",
"target": "x86_64-unknown-linux-gnu",
"artifact_name": "linux-x64-gpu",
"whl_local_version": "cuda",
"use_cuda": true,
"can_skip_in_simple_test": false
},
{
Expand All @@ -112,23 +106,20 @@ jobs:
"target": "aarch64-unknown-linux-gnu",
"artifact_name": "linux-arm64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"target": "aarch64-linux-android",
"artifact_name": "android-arm64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"target": "x86_64-linux-android",
"artifact_name": "android-x86_64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -137,7 +128,6 @@ jobs:
"target": "aarch64-apple-darwin",
"artifact_name": "osx-arm64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": false
},
{
Expand All @@ -146,31 +136,27 @@ jobs:
"target": "x86_64-apple-darwin",
"artifact_name": "osx-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "aarch64-apple-ios",
"artifact_name": "ios-arm64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "aarch64-apple-ios-sim",
"artifact_name": "ios-arm64-cpu-sim",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "x86_64-apple-ios",
"artifact_name": "ios-x64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
}
]'
Expand Down Expand Up @@ -242,7 +228,7 @@ jobs:
- name: Raplace resource
if: inputs.is_production
shell: bash
run: |
run:
mv -f download/resource/core/README.md ./README.md
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
Expand All @@ -268,7 +254,6 @@ jobs:
fi
env:
RUSTFLAGS: -C panic=abort
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_python_api
if: matrix.whl_local_version
id: build-voicevox-core-python-api
Expand All @@ -286,8 +271,6 @@ jobs:
build > /dev/null 2>&1
fi
echo "whl=$(find ./target/wheels -type f)" >> "$GITHUB_OUTPUT"
env:
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_java_api
if: contains(matrix.target, 'android')
run: |
Expand All @@ -305,7 +288,7 @@ jobs:
cp -v crates/voicevox_core_c_api/include/voicevox_core.h "artifact/${{ env.ASSET_NAME }}"
cp -v target/${{ matrix.target }}/release/*voicevox_core.{dll,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
cp -v target/${{ matrix.target }}/release/voicevox_core.dll.lib "artifact/${{ env.ASSET_NAME }}/voicevox_core.lib" || true
cp -v -n target/${{ matrix.target }}/release/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/*.{dll,so.*,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
cp -v -n target/${{ matrix.target }}/release/{,lib}onnxruntime*.{dll,so.*,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
# libonnxruntimeについてはバージョン付のshared libraryを使用するためバージョンがついてないものを削除する
rm -f artifact/${{ env.ASSET_NAME }}/libonnxruntime.{so,dylib}
cp -v README.md "artifact/${{ env.ASSET_NAME }}/README.txt"
Expand All @@ -315,15 +298,15 @@ jobs:
cp -v target/${{ matrix.target }}/release/libvoicevox_core_java_api.so java_artifact/ || true
- name: Code signing (Windows)
if: startsWith(matrix.os, 'windows') && inputs.code_signing
run: |
run:
bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll"
env:
ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }}
ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }}
ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }}
- name: Upload artifact to build XCFramework
if: contains(matrix.target, 'ios')
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: voicevox_core-${{ matrix.target }}
path: artifact/${{ env.ASSET_NAME }}
Expand Down Expand Up @@ -351,7 +334,7 @@ jobs:
target_commitish: ${{ github.sha }}
- name: Upload voicevox_core_java_api artifact
if: fromJson(needs.config.outputs.deploy) && contains(matrix.target, 'android')
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: voicevox_core_java_api-${{ matrix.artifact_name }}
path: java_artifact
Expand All @@ -361,44 +344,34 @@ jobs:
needs: [config, build_and_deploy]
runs-on: macos-12
env:
IOS_X86_64_PATH: artifact/voicevox_core-x86_64-apple-ios
IOS_AARCH64_SIM_PATH: artifact/voicevox_core-aarch64-apple-ios-sim
IOS_AARCH64_PATH: artifact/voicevox_core-aarch64-apple-ios
ASSET_NAME: voicevox_core-ios-xcframework-cpu-${{ needs.config.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: voicevox_core-x86_64-apple-ios
path: artifact/voicevox_core-x86_64-apple-ios
- uses: actions/download-artifact@v2
path: ${{ env.IOS_X86_64_PATH }}
- uses: actions/download-artifact@v4
with:
name: voicevox_core-aarch64-apple-ios-sim
path: artifact/voicevox_core-aarch64-apple-ios-sim
- uses: actions/download-artifact@v2
path: ${{ env.IOS_AARCH64_SIM_PATH }}
- uses: actions/download-artifact@v4
with:
name: voicevox_core-aarch64-apple-ios
path: artifact/voicevox_core-aarch64-apple-ios
- name: Create fat binary
path: ${{ env.IOS_AARCH64_PATH }}
- name: Create xcframework
id: create-xcframework
run: |
mkdir -p "artifact/voicevox_core-sim"
lipo -create "artifact/voicevox_core-x86_64-apple-ios/libvoicevox_core.dylib" "artifact/voicevox_core-aarch64-apple-ios-sim/libvoicevox_core.dylib" -output "artifact/voicevox_core-sim/libvoicevox_core.dylib"
- name: Create XCFramework
run: |
mkdir -p "artifact/${{ env.ASSET_NAME }}"
# 必要なファイルだけコピー
mkdir -p "Headers-sim"
cp -v artifact/voicevox_core-x86_64-apple-ios/voicevox_core.h "Headers-sim"
cp -v crates/voicevox_core_c_api/xcframework/Headers/module.modulemap "Headers-sim"
mkdir -p "Headers-aarch64"
cp -v artifact/voicevox_core-aarch64-apple-ios/voicevox_core.h "Headers-aarch64"
cp -v crates/voicevox_core_c_api/xcframework/Headers/module.modulemap "Headers-aarch64"
xcodebuild -create-xcframework \
-library "artifact/voicevox_core-sim/libvoicevox_core.dylib" \
-headers "Headers-sim" \
-library "artifact/voicevox_core-aarch64-apple-ios/libvoicevox_core.dylib" \
-headers "Headers-aarch64" \
-output "artifact/${{ env.ASSET_NAME }}/voicevox_core.xcframework"
build_util/make_ios_xcframework.bash
echo "output_asset_path=${OUTPUT_ASSET_PATH}" >> "$GITHUB_OUTPUT"
env:
OUTPUT_ASSET_PATH: artifact/voicevox_core-ios-xcframework-cpu
- name: Archive artifact
run: |
cd artifact/${{ env.ASSET_NAME }}
cd ${{ steps.create-xcframework.outputs.output_asset_path }}
7z a "../../${{ env.ASSET_NAME }}.zip" "voicevox_core.xcframework"
- name: Upload to Release
if: fromJson(needs.config.outputs.deploy)
Expand Down Expand Up @@ -427,7 +400,7 @@ jobs:
- name: Raplace resource
if: inputs.is_production
shell: bash
run: |
run:
rm -r ./model; mv download/fat_resource/core/model ./model
- name: Create artifact
run: |
Expand Down Expand Up @@ -456,7 +429,7 @@ jobs:
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
Expand All @@ -469,7 +442,7 @@ jobs:
- name: Install cargo-edit
run: cargo binstall cargo-edit@^0.11 --no-confirm
- name: set cargo version
run: |
run:
cargo set-version "$VERSION" -p voicevox_core_java_api

- name: "Download artifact (android-arm64-cpu)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-deny
run: cargo binstall cargo-deny@^0.13 --no-confirm --log-level debug
run: cargo binstall cargo-deny@^0.14 --no-confirm --log-level debug
- name: cargo-deny
run: |
if ${{ !!github.event.release }}; then
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ on:
description: "テスト対象のコアのバージョン。無指定時はprerelease込みの最新release。"
type: string
required: false
push:
branches:
- main
pull_request:
paths:
- "Cargo.*"
- "crates/downloader/**"
- ".github/workflows/download_test.yml"
# 新しいビルドができるまで、このworkflowが壊れて動かないことを許容する
# https://github.com/VOICEVOX/voicevox_core/issues/741#issuecomment-1935303742
#push:
# branches:
# - main
#pull_request:
# paths:
# - "Cargo.*"
# - "crates/downloader/**"
# - ".github/workflows/download_test.yml"

env:
VERSION: ${{ inputs.version || 'prerelease-latest' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
python-version: "3.8"
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
Expand Down
Loading

0 comments on commit c6c7a51

Please sign in to comment.