Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into buffer-0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Apr 26, 2024
2 parents 40add8a + a14fc2c commit b247a89
Show file tree
Hide file tree
Showing 66 changed files with 2,602 additions and 1,189 deletions.
6 changes: 0 additions & 6 deletions .github/labeler.yml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
# version が指定されている場合のみ実行する
if: needs.config.outputs.version_or_latest != 'latest'
needs: [config, build-docker]
uses: ./.github/workflows/release-test-docker.yml
uses: ./.github/workflows/test-engine-container.yml
with:
version: ${{ needs.config.outputs.version_or_latest }}
repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ jobs:
CUDA_ROOT=$( echo "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | tr '\\' '/' )
mkdir -p download/cuda/bin
if [[ ${{ matrix.os }} == windows-* ]]; then
# NOTE 1: actionlint による GitHub Actions 文法の暗示的 `________________` 置換が SchellCheck の `never be equal` エラーを起こさないように、変数代入する
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
OS=${{ matrix.os }}
if [[ $OS == windows-* ]]; then
mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/
# remove CUDA to reduce disk usage
Expand Down Expand Up @@ -202,7 +205,9 @@ jobs:
run: |
set -eux
if [[ ${{ matrix.os }} == windows-* ]]; then
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
OS=${{ matrix.os }}
if [[ $OS == windows-* ]]; then
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip
unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp
Expand Down Expand Up @@ -358,7 +363,9 @@ jobs:
curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip
# extract only dlls
if [[ ${{ matrix.target }} != *-directml ]]; then
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
TARGET=${{ matrix.target }}
if [[ $TARGET != *-directml ]]; then
unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/
mv download/onnxruntime-* download/onnxruntime
else
Expand Down Expand Up @@ -420,7 +427,9 @@ jobs:
VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
run: |
curl -L "https://github.com/VOICEVOX/voicevox_core/releases/download/${{ env.VOICEVOX_CORE_VERSION }}/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip" > download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
if [[ ${{ matrix.os }} == mac-* ]]; then
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
OS=${{ matrix.os }}
if [[ $OS == mac-* ]]; then
ditto -x -k --sequesterRsrc --rsrc download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip download/
else
unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
Expand All @@ -446,10 +455,12 @@ jobs:
# Replace version & specify dynamic libraries
$sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py
if [[ ${{ matrix.os }} == windows-* ]]; then
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
OS=${{ matrix.os }}
if [[ $OS == windows-* ]]; then
LIBCORE_PATH=download/core/voicevox_core.dll
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll
elif [[ ${{ matrix.os }} == macos-* ]]; then
elif [[ $OS == macos-* ]]; then
LIBCORE_PATH=download/core/libvoicevox_core.dylib
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib
else
Expand Down Expand Up @@ -494,7 +505,9 @@ jobs:
rm -rf download/zlib
fi
if [[ ${{ matrix.target }} == *-directml ]]; then
# 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
TARGET=${{ matrix.target }}
if [[ $TARGET == *-directml ]]; then
# DirectML
mv download/directml/DirectML.dll dist/run/
Expand Down Expand Up @@ -641,7 +654,7 @@ jobs:
run-release-test-workflow:
if: needs.config.outputs.version != ''
needs: [config, build-and-upload]
uses: ./.github/workflows/release-test.yml
uses: ./.github/workflows/test-engine-package.yml
with:
version: ${{ needs.config.outputs.version }}
repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build.yml',
workflow_id: 'build-engine-package.yml',
ref: 'master',
inputs: {
version: dev_version,
Expand All @@ -40,7 +40,7 @@ jobs:
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-docker.yml',
workflow_id: 'build-engine-container.yml',
ref: 'master',
inputs: {
version: dev_version
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/labeler.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ jobs:
run: |
OUTPUT_LICENSE_JSON_PATH=/dev/null \
bash build_util/create_venv_and_generate_licenses.bash
- name: Test names by checking typo
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
uses: crate-ci/[email protected]
22 changes: 0 additions & 22 deletions .github/workflows/typos.yml

This file was deleted.

10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pyinstaller --noconfirm run.spec

#### Github Actions でビルド

fork したリポジトリで Actions を ON にし、workflow_dispatch で`build.yml`を起動すればビルドできます。
fork したリポジトリで Actions を ON にし、workflow_dispatch で`build-engine-package.yml`を起動すればビルドできます。
成果物は Release にアップロードされます。

### コードフォーマット
Expand Down Expand Up @@ -205,6 +205,14 @@ poetry export --without-hashes --with license -o requirements-license.txt
- LGPL: OK (コアと動的分離されているため)
- GPL: NG (全関連コードの公開が必要なため)

#### 脆弱性診断
`safety` を用いた脆弱性診断により依存パッケージの安全性を確保しています。
以下のコマンドにより脆弱性を診断できます:

```bash
safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-license.txt
```

### API ドキュメントの確認

[API ドキュメント](https://voicevox.github.io/voicevox_engine/api/)(実体は`docs/api/index.html`)は自動で更新されます。
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# VOICEVOX ENGINE

[![build](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build.yml)
[![build](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-package.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-package.yml)
[![releases](https://img.shields.io/github/v/release/VOICEVOX/voicevox_engine)](https://github.com/VOICEVOX/voicevox_engine/releases)
[![discord](https://img.shields.io/discord/879570910208733277?color=5865f2&label=&logo=discord&logoColor=ffffff)](https://discord.gg/WMwWetrzuh)

[![test](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/VOICEVOX/voicevox_engine/badge.svg)](https://coveralls.io/github/VOICEVOX/voicevox_engine)

[![build-docker](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-docker.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-docker.yml)
[![build-docker](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-container.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-container.yml)
[![docker](https://img.shields.io/docker/pulls/voicevox/voicevox_engine)](https://hub.docker.com/r/voicevox/voicevox_engine)

[VOICEVOX](https://voicevox.hiroshiba.jp/) のエンジンです。
Expand Down Expand Up @@ -560,7 +560,7 @@ pyinstaller --noconfirm run.spec

#### Github Actions でビルド

fork したリポジトリで Actions を ON にし、workflow_dispatch で`build.yml`を起動すればビルドできます。
fork したリポジトリで Actions を ON にし、workflow_dispatch で`build-engine-package.yml`を起動すればビルドできます。
成果物は Release にアップロードされます。

### コードフォーマット
Expand Down
2 changes: 2 additions & 0 deletions build_util/create_venv_and_generate_licenses.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ VENV_PATH="licenses_venv"

python -m venv $VENV_PATH
if [ -d "$VENV_PATH/Scripts" ]; then
# shellcheck disable=SC1091
source $VENV_PATH/Scripts/activate
else
# shellcheck disable=SC1091
source $VENV_PATH/bin/activate
fi

Expand Down
15 changes: 15 additions & 0 deletions build_util/generate_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from typing import List, Optional


class LicenseError(Exception):
# License違反があった場合、このエラーを出します。
pass


@dataclass
class License:
name: str
Expand Down Expand Up @@ -162,6 +167,16 @@ def generate_licenses() -> List[License]:
license=license_json["License"],
text=license_json["LicenseText"],
)
license_names_str = license.license or ""
license_names = license_names_str.split("; ")
for license_name in license_names:
if license_name in [
"GNU General Public License v2 (GPLv2)",
"GNU General Public License (GPL)",
"GNU General Public License v3 (GPLv3)",
"GNU Affero General Public License v3 (AGPL-3)",
]:
raise LicenseError(f"ライセンス違反: {license.name}")
# FIXME: assert license type
if license.text == "UNKNOWN":
if license.name.lower() == "core" and license.version == "0.0.0":
Expand Down
2 changes: 1 addition & 1 deletion build_util/process_voicevox_resource.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ python build_util/merge_update_infos.py \
"${DOWNLOAD_RESOURCE_PATH}/engine/engine_manifest_assets/update_infos.json" \
engine_manifest_assets/update_infos.json

for f in $(ls $DOWNLOAD_RESOURCE_PATH/engine/engine_manifest_assets/* | grep -v update_infos.json); do
for f in $(ls "${DOWNLOAD_RESOURCE_PATH}"/engine/engine_manifest_assets/* | grep -v update_infos.json); do
cp "${f}" ./engine_manifest_assets/
done
Loading

0 comments on commit b247a89

Please sign in to comment.