Skip to content

Commit

Permalink
[project-s] mainブランチをマージ (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-chan committed Jan 13, 2024
2 parents 3974766 + 6ceebc7 commit 8d23bd3
Show file tree
Hide file tree
Showing 110 changed files with 8,611 additions and 6,723 deletions.
14 changes: 7 additions & 7 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.3"
VOICEVOX_CORE_VERSION: "0.14.4"
VOICEVOX_RESOURCE_VERSION: "0.14.5"
VOICEVOX_CORE_VERSION: "0.14.6"

defaults:
run:
Expand All @@ -35,12 +35,12 @@ jobs:
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT
build-docker:
needs: [ config ]
needs: [config]
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
tag:
- ""
- cpu
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
platforms: linux/amd64

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -106,7 +106,7 @@ jobs:

- name: Checkout VOICEVOX RESOURCE
if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: VOICEVOX/voicevox_resource
ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
run-release-test-workflow:
# version が指定されている場合のみ実行する
if: needs.config.outputs.version_or_latest != 'latest'
needs: [ config, build-docker ]
needs: [config, build-docker]
uses: ./.github/workflows/release-test-docker.yml
with:
version: ${{ needs.config.outputs.version_or_latest }}
Expand Down
50 changes: 33 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ on:
code_signing:
description: "コード署名する"
type: boolean
default: false
upload_artifact:
description: "デバッグ用に成果物をartifactにアップロードするか"
type: boolean
default: false

env:
PYTHON_VERSION: "3.11.3"
VOICEVOX_RESOURCE_VERSION: "0.14.3"
VOICEVOX_CORE_VERSION: "0.14.4"
VOICEVOX_RESOURCE_VERSION: "0.14.5"
VOICEVOX_CORE_VERSION: "0.14.6"

defaults:
run:
Expand Down Expand Up @@ -109,7 +110,7 @@ jobs:
run: |
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# NOTE: The default 'sed' and 'split' of macOS is BSD 'sed' and 'split'.
# There is a difference in specification between BSD 'sed' and 'split' and GNU 'sed' and 'split',
Expand Down Expand Up @@ -273,7 +274,7 @@ jobs:
# Python install path of windows: C:/hostedtoolcache/windows/Python
- name: Setup Python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.architecture }}
Expand Down Expand Up @@ -393,7 +394,7 @@ jobs:

- name: Checkout VOICEVOX RESOURCE
if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: VOICEVOX/voicevox_resource
ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
Expand Down Expand Up @@ -436,10 +437,6 @@ jobs:
rm -rf download/${{ env.VOICEVOX_CORE_ASSET_NAME }}
rm download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
- name: Copy VOICEVOX Core Models
run: |
cp -r download/core/model ./
- name: Generate licenses.json
run: |
OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \
Expand Down Expand Up @@ -467,9 +464,10 @@ jobs:
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.so
fi
LIBCORE_PATH="$LIBCORE_PATH" \
LIBONNXRUNTIME_PATH="$LIBONNXRUNTIME_PATH" \
pyinstaller --noconfirm run.spec
pyinstaller --noconfirm run.spec -- \
--libcore_path="$LIBCORE_PATH" \
--libonnxruntime_path="$LIBONNXRUNTIME_PATH" \
--core_model_dir_path="download/core/model"
- name: Gather DLL dependencies to dist/run/ (Windows)
if: startsWith(matrix.os, 'windows-')
Expand Down Expand Up @@ -548,8 +546,9 @@ jobs:
run: |
bash build_util/codesign.bash "dist/run/run.exe"
env:
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }}
ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }}
ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }}

- name: Rename artifact directory to archive
run: |
Expand Down Expand Up @@ -592,9 +591,15 @@ jobs:
# VVPP archives
- name: Create VVPP archives
run: |
# Compress to artifact.001.vvppp,artifact.002.vvppp, ...
(cd "${{ matrix.target }}" && 7z -r a "../compressed.zip")
$split -b 1900M --numeric-suffixes=1 -a 3 --additional-suffix .vvppp ./compressed.zip ./${{ steps.vars.outputs.package_name }}.
# Compress to compressed.zip.001, compressed.zip.002, ...
# NOTE: 1000th archive will be "compressed.zip.1000" after "compressed.zip.999". This is unconsidered as an extreme case.
(cd "${{ matrix.target }}" && 7z -r -v1900M a "../compressed.zip")
# Rename to artifact.001.vvppp, artifact.002.vvppp, ...
for FILE in $(ls "compressed.zip."*); do
NUMBER=${FILE##*.} # 001
mv "${FILE}" "${{ steps.vars.outputs.package_name }}.${NUMBER}.vvppp"
done
# Rename to artifact.vvpp if there are only artifact.001.vvppp
if [ "$(ls ${{ steps.vars.outputs.package_name }}.*.vvppp | wc -l)" == 1 ]; then
Expand Down Expand Up @@ -629,6 +634,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
4 changes: 2 additions & 2 deletions .github/workflows/coverage-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Download coverage report
uses: actions/github-script@v5.0.0
uses: actions/github-script@v7
with:
script: |
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -42,7 +42,7 @@ jobs:
run: unzip report.zip

- name: Comment coverage result to Pull Requests
uses: actions/github-script@v5.0.0
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
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@v2.0
- uses: github/issue-labeler@v3.3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release-test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,16 @@ jobs:
- cpu-ubuntu20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

#
# Setup Python Environment
#
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11.3"
cache: pip

- name: Install libsndfile1
run: |
sudo apt-get update
sudo apt-get install libsndfile1
- name: Install requirements
run: |
pip install -r requirements-test.txt
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
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@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: "3.11.3"
cache: pip
Expand All @@ -78,12 +78,6 @@ jobs:
if: startsWith(matrix.target, 'linux') || startsWith(matrix.target, 'macos')
run: chmod +x dist/run

- name: Install libsndfile1
if: startsWith(matrix.target, 'linux')
run: |
sudo apt-get update
sudo apt-get install libsndfile1
- name: Install requirements
run: |
pip install -r requirements-test.txt
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release_latest_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release latest dev build

# masterブランチが更新されるたびに開発版をビルドしてデプロイする。
# バージョン(タグ)は最新リリースのバージョンを`X.Y.Z`としたときの`X.Y+1.0-dev`。

on:
push:
branches:
- master
paths-ignore:
- "docs/**"
- "test/**"

jobs:
latest-dev-build:
runs-on: ubuntu-latest
if: github.repository_owner == 'VOICEVOX'
steps:
- name: Trigger workflow_dispatch
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const latest_release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
const split_version = latest_release.data.tag_name.split('.');
const dev_version = `${split_version[0]}.${parseInt(split_version[1]) + 1}.0-dev`;
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build.yml',
ref: 'master',
inputs: {
version: dev_version,
prerelease: true
}
})
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-docker.yml',
ref: 'master',
inputs: {
version: dev_version
}
})
console.log(`Triggered workflow_dispatch for ${dev_version}`);
24 changes: 18 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,35 @@ jobs:
python: ["3.11.3"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip

- name: Install libraries for ubuntu
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install libsndfile1

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-test.txt
- name: Run poetry and check
run: |
poetry export --without-hashes -o requirements.txt.check
poetry export --without-hashes --with dev -o requirements-dev.txt.check
poetry export --without-hashes --with test -o requirements-test.txt.check
poetry export --without-hashes --with license -o requirements-license.txt.check
diff -q requirements.txt requirements.txt.check || \
diff -q requirements-dev.txt requirements-dev.txt.check || \
diff -q requirements-test.txt requirements-test.txt.check || \
diff -q requirements-license.txt requirements-license.txt.check > /dev/null
if [ $? = 1 ]; then
echo "poetry export has some diff"
exit 1
fi
- run: pysen run lint

- name: Run pytest and get coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: typos-action
uses: crate-ci/typos@v1.12.12
11 changes: 5 additions & 6 deletions .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 All @@ -19,25 +21,22 @@ jobs:
upload-doc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: Install libraries for ubuntu
run: sudo apt-get install libsndfile1

- name: Install Python dependencies
run: |
pip install -r requirements.txt
- 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
Loading

0 comments on commit 8d23bd3

Please sign in to comment.