Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into コアのmodelディレクトリを分離
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Oct 12, 2023
2 parents d5c370f + 76ce1fe commit a948eb5
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 32 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
build_and_deploy:
needs: config
environment: ${{ inputs.is_production == 'true' && 'production' || '' }} # 製品版のenvironment
environment: ${{ inputs.is_production && 'production' || '' }} # 製品版のenvironment
strategy:
matrix:
include: ${{ fromJson(needs.config.outputs.includes) }}
Expand All @@ -193,14 +193,14 @@ jobs:
ASSET_NAME: voicevox_core-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}
steps:
- uses: actions/checkout@v3 # 製品版ではない場合
if: ${{ inputs.is_production != 'true' }}
if: ${{ !inputs.is_production }}
- uses: actions/checkout@v3 # 製品版の場合
if: ${{ inputs.is_production == 'true' }}
if: inputs.is_production
with:
fetch-depth: 0 # 全履歴取得
token: ${{ secrets.PRODUCTION_GITHUB_TOKEN }}
- name: Merge production branch
if: inputs.is_production == 'true'
if: inputs.is_production
shell: bash
run: |
(
Expand Down Expand Up @@ -233,14 +233,14 @@ jobs:
echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> "$GITHUB_PATH"
echo "AR_${{ matrix.target }}=llvm-ar" >> "$GITHUB_ENV"
- name: Checkout VOICEVOX RESOURCE
if: inputs.is_production == 'true'
if: inputs.is_production
uses: actions/checkout@v3
with:
repository: VOICEVOX/voicevox_resource
ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
path: download/resource
- name: Raplace resource
if: inputs.is_production == 'true'
if: inputs.is_production
shell: bash
run: |
mv -f download/resource/core/README.md ./README.md
Expand All @@ -254,14 +254,14 @@ jobs:
if ${{ !!matrix.whl_local_version }}; then cargo set-version "$VERSION+"${{ matrix.whl_local_version }} -p voicevox_core_python_api; fi
- name: cache target
uses: Swatinem/rust-cache@v2
if: inputs.is_production != 'true'
if: ${{ !inputs.is_production }}
- name: build voicevox_core_c_api
shell: bash
run: |
function build() {
cargo build -p voicevox_core_c_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -278,7 +278,7 @@ jobs:
function build() {
maturin build --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -292,7 +292,7 @@ jobs:
function build() {
cargo build -p voicevox_core_java_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -313,7 +313,7 @@ jobs:
mkdir java_artifact
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 == 'true'
if: startsWith(matrix.os, 'windows') && inputs.code_signing
run: |
bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll"
env:
Expand All @@ -331,7 +331,7 @@ jobs:
cd artifact
7z a "../${{ env.ASSET_NAME }}.zip" "${{ env.ASSET_NAME }}"
- name: Upload to Release
if: needs.config.outputs.deploy == 'true' && !contains(matrix.target, 'ios')
if: fromJson(needs.config.outputs.deploy) && !contains(matrix.target, 'ios')
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -340,7 +340,7 @@ jobs:
${{ env.ASSET_NAME }}.zip
target_commitish: ${{ github.sha }}
- name: Upload Python whl to Release
if: needs.config.outputs.deploy == 'true' && matrix.whl_local_version
if: fromJson(needs.config.outputs.deploy) && matrix.whl_local_version
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -349,7 +349,7 @@ jobs:
${{ steps.build-voicevox-core-python-api.outputs.whl }}
target_commitish: ${{ github.sha }}
- name: Upload voicevox_core_java_api artifact
if: needs.config.outputs.deploy == 'true' && contains(matrix.target, 'android')
if: fromJson(needs.config.outputs.deploy) && contains(matrix.target, 'android')
uses: actions/upload-artifact@v3
with:
name: voicevox_core_java_api-${{ matrix.artifact_name }}
Expand Down Expand Up @@ -400,7 +400,7 @@ jobs:
cd artifact/${{ env.ASSET_NAME }}
7z a "../../${{ env.ASSET_NAME }}.zip" "voicevox_core.xcframework"
- name: Upload to Release
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -417,14 +417,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Checkout VOICEVOX FAT RESOURCE
if: inputs.is_production == 'true'
if: inputs.is_production
uses: actions/checkout@v3
with:
repository: VOICEVOX/voicevox_fat_resource
ref: ${{ env.VOICEVOX_FAT_RESOURCE_VERSION }}
path: download/fat_resource
- name: Raplace resource
if: inputs.is_production == 'true'
if: inputs.is_production
shell: bash
run: |
rm -r ./model; mv download/fat_resource/core/model ./model
Expand Down Expand Up @@ -511,7 +511,7 @@ jobs:
zip -r /tmp/java_packages.zip .
- name: Upload to Release
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -522,7 +522,7 @@ jobs:

download_test:
needs: [config, build_and_deploy]
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: ./.github/workflows/download_test.yml
with:
version: ${{ inputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy_downloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defaults:

jobs:
deploy_and_deploy_downloader:
environment: ${{ inputs.is_production == 'true' && 'production' || '' }} # コード署名用のenvironment
environment: ${{ inputs.is_production && 'production' || '' }} # コード署名用のenvironment
strategy:
matrix:
include:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
mv $"target/${{ matrix.target }}/release/download$exe_suffix" ./${{ matrix.name }}
- name: Code signing (Windows)
if: startsWith(matrix.os, 'windows') && inputs.code_signing == 'true'
if: startsWith(matrix.os, 'windows') && inputs.code_signing
run: |
bash build_util/codesign.bash ./${{ matrix.name }}
env:
Expand Down
4 changes: 2 additions & 2 deletions crates/voicevox_core/src/voice_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl VvmEntryReader {
}

async fn read_vvm_entry(&self, filename: &str) -> LoadModelResult<Vec<u8>> {
(|| async {
async {
let me = self
.entry_map
.get(filename)
Expand All @@ -190,7 +190,7 @@ impl VvmEntryReader {
.read_to_end_checked(&mut buf, &me.entry)
.await?;
Ok::<_, anyhow::Error>(buf)
})()
}
.await
.map_err(|source| LoadModelError {
path: self.reader.path().to_owned(),
Expand Down
4 changes: 2 additions & 2 deletions crates/voicevox_core_c_api/src/compatible_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn set_message(message: &str) {

#[no_mangle]
pub extern "C" fn initialize(use_gpu: bool, cpu_num_threads: c_int, load_all_models: bool) -> bool {
let result = RUNTIME.block_on((|| async {
let result = RUNTIME.block_on(async {
let synthesizer = voicevox_core::Synthesizer::new_with_initialize(
Arc::new(OpenJtalk::new_without_dic()),
&voicevox_core::InitializeOptions {
Expand All @@ -89,7 +89,7 @@ pub extern "C" fn initialize(use_gpu: bool, cpu_num_threads: c_int, load_all_mod
}

Ok::<_, voicevox_core::Error>(synthesizer)
})());
});

match result {
Ok(synthesizer) => {
Expand Down
4 changes: 2 additions & 2 deletions crates/voicevox_core_python_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl Synthesizer {
.iter()
.map(|ap| to_pydantic_dataclass(ap, class))
.collect::<PyResult<Vec<_>>>();
let list = PyList::new(py, accent_phrases.into_iter());
let list = PyList::new(py, accent_phrases);
Ok(list.to_object(py))
})
},
Expand Down Expand Up @@ -314,7 +314,7 @@ impl Synthesizer {
.iter()
.map(|ap| to_pydantic_dataclass(ap, class))
.collect::<PyResult<Vec<_>>>();
let list = PyList::new(py, accent_phrases.into_iter());
let list = PyList::new(py, accent_phrases);
Ok(list.to_object(py))
})
},
Expand Down
19 changes: 15 additions & 4 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,30 @@
"config:recommended"
],
"timezone": "Asia/Tokyo",
"schedule": [
"before 1am"
"packageRules": [
{
"groupSlug": "rust",
"groupName": "Rust",
"matchPackagePatterns": "^Rust$"
},
{
"groupSlug": "others",
"groupName": "Others",
"excludePackagePatterns": "^Rust$",
"dependencyDashboardApproval": true
}
],
"regexManagers": [
"customManagers": [
{
"customType": "regex",
"fileMatch": [
"^rust-toolchain$"
],
"matchStrings": [
"(?<currentValue>\\d+\\.\\d+\\.\\d+)"
],
"depNameTemplate": "Rust",
"lookupNameTemplate": "rust-lang/rust",
"packageNameTemplate": "rust-lang/rust",
"datasourceTemplate": "github-releases"
}
]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.71.1
1.73.0

0 comments on commit a948eb5

Please sign in to comment.