Skip to content

Commit

Permalink
Merge branch 'master' into pr/kdrkdrkdr/834
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Feb 25, 2024
2 parents e4ccbe8 + f181411 commit b61d52c
Show file tree
Hide file tree
Showing 141 changed files with 22,394 additions and 5,333 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
test/**/__snapshots__/**/*.json linguist-generated=true

* text=auto
*.png -text
*.wav -text
*.wav -text
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
env:
IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.11.3"
VOICEVOX_RESOURCE_VERSION: "0.14.4"
VOICEVOX_CORE_VERSION: "0.14.5"
VOICEVOX_RESOURCE_VERSION: "0.16.0"
VOICEVOX_CORE_VERSION: "0.15.0"

defaults:
run:
Expand All @@ -32,7 +32,7 @@ jobs:
id: vars
run: |
: # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> "$GITHUB_OUTPUT"
build-docker:
needs: [config]
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ on:

env:
PYTHON_VERSION: "3.11.3"
VOICEVOX_RESOURCE_VERSION: "0.14.4"
VOICEVOX_CORE_VERSION: "0.14.5"
VOICEVOX_RESOURCE_VERSION: "0.16.0"
VOICEVOX_CORE_VERSION: "0.15.0"

defaults:
run:
Expand All @@ -44,9 +44,9 @@ jobs:
id: vars
run: |
: # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列
echo "version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT
echo "version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
: # release タグ名, または workflow_dispatch でのバージョン名, または 'latest'
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> "$GITHUB_OUTPUT"
build-and-upload:
needs: [config]
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: declare variables
id: vars
run: |
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4

Expand Down Expand Up @@ -420,14 +420,7 @@ 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
# NOTE: Windows 版コアのみ PowerShell の Compress-Archive コマンドレットを用いて zip を作成している(デフォルト状態では zip コマンドが存在していないため)。
# このコマンドはバージョンによっては作成した zip 内のパスの区切り文字がバックスラッシュになる。 (cf. https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/48)
# unzip コマンドはこのような zip ファイルを解凍できるものの、終了コード 1 を報告して CI が落ちてしまう。
# 回避策として、unzip コマンドの代わりに 7z コマンドを用いて zip ファイルを解凍する。
# unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
if [[ ${{ matrix.os }} == windows-* ]]; then
7z x -o"download" download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
elif [[ ${{ matrix.os }} == mac-* ]]; then
if [[ ${{ matrix.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 Down Expand Up @@ -634,6 +627,17 @@ jobs:
${{ steps.vars.outputs.package_name }}.vvpp.txt
commit: ${{ github.sha }}

update-tag-to-current-commit:
if: needs.config.outputs.version != ''
needs: [config, build-and-upload]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Change tag to this commit for refreshing the release # c.f. voicevox_engine#854
run: |
git tag -f ${{ needs.config.outputs.version }}
git push -f --tag
run-release-test-workflow:
if: needs.config.outputs.version != ''
needs: [config, build-and-upload]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3
- uses: github/issue-labeler@v3.3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release-test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
id: docker_vars
run: |
if [ "${{ matrix.tag }}" != "" ]; then
echo "image_tag=${{ env.IMAGE_NAME }}:${{ matrix.tag }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "image_tag=${{ env.IMAGE_NAME }}:${{ matrix.tag }}-${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
else
echo "image_tag=${{ env.IMAGE_NAME }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "image_tag=${{ env.IMAGE_NAME }}:${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
fi
- name: Docker pull
Expand All @@ -81,14 +81,14 @@ jobs:
max_attempts=10
sleep_interval=5
for i in $(seq 1 $max_attempts); do
status=$(curl -o /dev/null -s -w '%{http_code}\n' $url)
if [ $status -eq 200 ]; then
echo "Container is ready! Response status code: $status"
for i in $(seq 1 "$max_attempts"); do
status=$(curl -o /dev/null -s -w '%{http_code}\n' "$url")
if [ "$status" -eq 200 ]; then
echo "Container is ready! Response status code: ${status}"
exit 0
else
echo "Attempt $i/$max_attempts: Response status code $status"
sleep $sleep_interval
echo "Attempt ${i}/${max_attempts}: Response status code $status"
sleep "${sleep_interval}"
fi
done
exit 1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
- name: declare variables
id: vars
run: |
echo "release_url=${{ env.REPO_URL }}/releases/download/${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "release_url=${{ env.REPO_URL }}/releases/download/${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4

Expand All @@ -72,7 +72,7 @@ jobs:
curl -L -o "download/list.txt" "${{ steps.vars.outputs.release_url }}/${{ steps.vars.outputs.package_name }}.7z.txt"
cat "download/list.txt" | xargs -I '%' curl -L -o "download/%" "${{ steps.vars.outputs.release_url }}/%"
7z x "download/$(head -n1 download/list.txt)"
mv ${{ matrix.target }} dist/
mv "${{ matrix.target }}" dist/
- name: chmod +x
if: startsWith(matrix.target, 'linux') || startsWith(matrix.target, 'macos')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-latest] # [ubuntu-20.04, macos-latest, windows-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]
python: ["3.11.3"]

steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/upload-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# API docs HTML ファイルを生成し、`gh-pages` ブランチへの push によって GitHub Pages 上のドキュメントとして公開

name: upload-docs

on:
Expand Down Expand Up @@ -34,7 +36,7 @@ jobs:
- name: Make documents
run: |
python make_docs.py
PYTHONPATH=. python build_util/make_docs.py
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EOF
# assert VOICEVOX_CORE_VERSION >= 0.11.0 (ONNX)
ARG TARGETPLATFORM
ARG USE_GPU=false
ARG VOICEVOX_CORE_VERSION=0.14.5
ARG VOICEVOX_CORE_VERSION=0.15.0

RUN <<EOF
set -eux
Expand Down Expand Up @@ -227,7 +227,8 @@ COPY --from=download-onnxruntime-env /opt/onnxruntime /opt/onnxruntime
# Add local files
ADD ./voicevox_engine /opt/voicevox_engine/voicevox_engine
ADD ./docs /opt/voicevox_engine/docs
ADD ./run.py ./generate_licenses.py ./presets.yaml ./default.csv ./default_setting.yml ./engine_manifest.json /opt/voicevox_engine/
ADD ./run.py ./presets.yaml ./default.csv ./engine_manifest.json /opt/voicevox_engine/
ADD ./build_util/generate_licenses.py /opt/voicevox_engine/build_util/
ADD ./speaker_info /opt/voicevox_engine/speaker_info
ADD ./ui_template /opt/voicevox_engine/ui_template
ADD ./engine_manifest_assets /opt/voicevox_engine/engine_manifest_assets
Expand All @@ -249,7 +250,7 @@ RUN <<EOF
export PATH="/home/user/.local/bin:${PATH:-}"

gosu user /opt/python/bin/pip3 install -r /tmp/requirements-license.txt
gosu user /opt/python/bin/python3 generate_licenses.py > /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json
gosu user /opt/python/bin/python3 build_util/generate_licenses.py > /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json
cp /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json
EOF

Expand All @@ -274,7 +275,7 @@ RUN <<EOF
EOF

# Download Resource
ARG VOICEVOX_RESOURCE_VERSION=0.14.4
ARG VOICEVOX_RESOURCE_VERSION=0.16.0
RUN <<EOF
set -eux

Expand Down
Loading

0 comments on commit b61d52c

Please sign in to comment.