-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Hiroshiba <hihokaruta@gmail.com>
- Loading branch information
1 parent
8f670e2
commit 9e8fdc7
Showing
11 changed files
with
527 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
DEFAULT_ENGINE_INFOS=`[ | ||
{ | ||
"uuid": "074fc39e-678b-4c13-8916-ffca8d505d1d", | ||
"name": "VOICEVOX Engine", | ||
"executionEnabled": true, | ||
"executionFilePath": "../voicevox_engine/run.exe", | ||
"executionArgs": [], | ||
"host": "http://127.0.0.1:50021" | ||
} | ||
]` | ||
VITE_GTM_CONTAINER_ID=GTM-DUMMY | ||
VV_OUTPUT_LOG_UTF8=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: "Download VOICEVOX ENGINE" | ||
description: | | ||
VOICEVOX ENGINEをダウンロードし、指定したディレクトリに展開する。 | ||
inputs: | ||
version: | ||
description: "VOICEVOX ENGINEのバージョン。latest(デフォルト)、prerelease-latest、バージョン番号(例:0.14.4)で指定できる。" | ||
required: false | ||
default: "latest" | ||
dest: | ||
description: "VOICEVOX ENGINEを展開するディレクトリ。" | ||
required: true | ||
target: | ||
description: "ダウンロードする対象。デフォルトは各OSのCPU版。" | ||
required: false | ||
default: "" | ||
|
||
outputs: | ||
run_path: | ||
description: "run.exe、またはrunのパス。" | ||
value: ${{ steps.result.outputs.run_path }} | ||
version: | ||
description: "VOICEVOX ENGINEのバージョン。" | ||
value: ${{ steps.result.outputs.version }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup tempdir | ||
shell: bash | ||
run: | | ||
TEMPDIR=$(echo '${{ runner.temp }}' | sed -e 's_\\_/_g') | ||
echo TEMPDIR=$TEMPDIR >> $GITHUB_ENV | ||
mkdir -p $TEMPDIR | ||
DEST=$(echo '${{ inputs.dest }}' | sed -e 's_\\_/_g') | ||
echo DEST=$DEST >> $GITHUB_ENV | ||
- name: Get version | ||
shell: bash | ||
run: | | ||
curl -s https://api.github.com/repos/voicevox/voicevox_engine/releases \ | ||
-H 'authorization: Bearer ${{ github.token }}' \ | ||
-H 'content-type: application/json' > $TEMPDIR/releases.json | ||
if [ "${{ inputs.version }}" = "latest" ]; then | ||
cat $TEMPDIR/releases.json | jq -er '[.[] | select(.prerelease == false)][0]' > $TEMPDIR/target.json | ||
elif [ "${{ inputs.version }}" = "prerelease-latest" ]; then | ||
cat $TEMPDIR/releases.json | jq -er '[.[] | select(.prerelease == true)][0]' > $TEMPDIR/target.json | ||
else | ||
cat $TEMPDIR/releases.json | jq -er '[.[] | select(.tag_name == "${{ inputs.version }}")][0]' > $TEMPDIR/target.json | ||
fi | ||
- name: Download and Extract | ||
shell: bash | ||
run: | | ||
if [ "${{ inputs.target }}" = "" ]; then | ||
OS="${{ runner.os }}" | ||
TARGET="${OS,,}-cpu" # 小文字にする | ||
else | ||
TARGET="${{ inputs.target }}" | ||
fi | ||
# リリース情報からファイル一覧のtxtを取得 | ||
cat $TEMPDIR/target.json | jq -er '[.assets[] | select(.name | contains("'$TARGET'") and endswith(".7z.txt"))][0]' > $TEMPDIR/assets_txt.json | ||
LIST_URL=$(cat $TEMPDIR/assets_txt.json | jq -er '.browser_download_url') | ||
echo "7z.txt url: $LIST_URL" | ||
echo $LIST_URL | xargs curl -sSL > $TEMPDIR/download_name.txt | ||
echo "Files to download:" | ||
cat $TEMPDIR/download_name.txt | sed -e 's|^|- |' | ||
# ファイル一覧のtxtにあるファイルをダウンロード | ||
for i in $(cat $TEMPDIR/download_name.txt); do | ||
URL=$(cat $TEMPDIR/target.json | jq -er "[.assets[] | select(.name == \"$i\")][0].browser_download_url") | ||
echo "Download url: $URL, dest: $TEMPDIR/$i" | ||
curl -sSL $URL -o $TEMPDIR/$i & | ||
done | ||
for job in `jobs -p`; do | ||
wait $job | ||
done | ||
# 一時ディレクトリに展開してから、本体(windows-cpuなどの中)を取り出す | ||
7z x -y -o$TEMPDIR/tmp-extract $TEMPDIR/$(head -1 $TEMPDIR/download_name.txt) | ||
mkdir -p $DEST | ||
mv $TEMPDIR/tmp-extract/$TARGET/* $DEST | ||
echo "::group::ll $DEST" | ||
ls -al $DEST | ||
echo "::endgroup::" | ||
- name: Set output | ||
id: result | ||
shell: bash | ||
run: | | ||
if [ "${{ runner.os }}" = "Windows" ]; then | ||
echo "run_path=$DEST/run.exe" >> $GITHUB_OUTPUT | ||
else | ||
echo "run_path=$DEST/run" >> $GITHUB_OUTPUT | ||
fi | ||
cat $TEMPDIR/target.json | jq -r '.tag_name' | sed -e 's_^_version=_' >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.