Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

整理: シェルスクリプトに lint を適用 #1122

Merged
merged 5 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/build-engine-package.yml
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 }}
tarepan marked this conversation as resolved.
Show resolved Hide resolved
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
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
tarepan marked this conversation as resolved.
Show resolved Hide resolved

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