From 54e44a332496d170e9fe2adb40099c1092f3259e Mon Sep 17 00:00:00 2001 From: sarisia Date: Sun, 25 Dec 2022 14:52:47 +0000 Subject: [PATCH 01/14] include product name and version to release files --- .github/workflows/build.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5dd32a17..8998210c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -511,6 +511,8 @@ jobs: - windows-cpu - windows-directml - windows-nvidia + env: + package_name: voicevox_engine-${{ env.VOICEVOX_ENGINE_VERSION }}-${{ matrix.artifact_name }} steps: - uses: actions/checkout@v3 @@ -529,22 +531,22 @@ jobs: - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ matrix.artifact_name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ env.package_name }}.7z" "${{ matrix.artifact_name }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) - split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ matrix.artifact_name }}. + split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ env.package_name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp - if [ "$(ls ${{ matrix.artifact_name }}.*.vvpp | wc -l)" == 1 ]; then - mv ${{ matrix.artifact_name }}.001.vvpp ${{ matrix.artifact_name }}.vvpp + if [ "$(ls ${{ env.package_name }}.*.vvpp | wc -l)" == 1 ]; then + mv ${{ env.package_name }}.001.vvpp ${{ env.package_name }}.vvpp fi # Output splitted archive list - ls ${{ matrix.artifact_name }}.7z.* > archives_7z.txt - mv archives_7z.txt "${{ matrix.artifact_name }}.7z.txt" - ls ${{ matrix.artifact_name }}*.vvpp > archives_vvpp.txt - mv archives_vvpp.txt "${{ matrix.artifact_name }}.vvpp.txt" + ls ${{ env.package_name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ env.package_name }}.7z.txt" + ls ${{ env.package_name }}*.vvpp > archives_vvpp.txt + mv archives_vvpp.txt "${{ env.package_name }}.vvpp.txt" - name: Upload splitted archives to Release assets uses: softprops/action-gh-release@v1 @@ -552,9 +554,9 @@ jobs: prerelease: ${{ github.event.inputs.prerelease }} tag_name: ${{ env.VOICEVOX_ENGINE_VERSION }} files: |- - ${{ matrix.artifact_name }}.7z.* - ${{ matrix.artifact_name }}*.vvpp - ${{ matrix.artifact_name }}.vvpp.txt + ${{ env.package_name }}.7z.* + ${{ env.package_name }}*.vvpp + ${{ env.package_name }}.vvpp.txt target_commitish: ${{ github.sha }} run-release-test-workflow: From dbe2e6b5f6ff9627626f43fd6b2c25a3ba3ed3d6 Mon Sep 17 00:00:00 2001 From: sarisia Date: Sun, 25 Dec 2022 14:58:06 +0000 Subject: [PATCH 02/14] match with voicevox editor --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8998210c5..5c2d26bd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -512,7 +512,7 @@ jobs: - windows-directml - windows-nvidia env: - package_name: voicevox_engine-${{ env.VOICEVOX_ENGINE_VERSION }}-${{ matrix.artifact_name }} + package_name: voicevox_engine-${{ matrix.artifact_name }}-${{ env.VOICEVOX_ENGINE_VERSION }} steps: - uses: actions/checkout@v3 From 61c1635776074cabd999bb1be3f3c6284a7c5e52 Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 16:51:29 +0000 Subject: [PATCH 03/14] fix --- .github/workflows/build.yml | 43 ++++++++++++++++-------------- .github/workflows/release-test.yml | 14 +++++++--- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c2d26bd3..dad99e5c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,8 @@ env: VOICEVOX_RESOURCE_VERSION: "0.13.3" VOICEVOX_CORE_VERSION: "0.14.0-preview.2" VOICEVOX_ENGINE_VERSION: - |- # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る - ${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }} + |- # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列. + ${{ github.event.release.tag_name || github.event.inputs.version }} jobs: build-all: @@ -391,11 +391,11 @@ jobs: # Replace version & specify dynamic libraries if [[ ${{ matrix.os }} == macos-* ]]; then - gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py + gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION || 'latest' }}\"/" voicevox_engine/__init__.py LIBCORE_PATH=download/core/libvoicevox_core.dylib LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib else - sed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py + sed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION || 'latest' }}\"/" voicevox_engine/__init__.py if [[ ${{ matrix.os }} == windows-* ]]; then LIBCORE_PATH=download/core/voicevox_core.dll LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll @@ -499,7 +499,7 @@ jobs: path: dist/run/ upload-to-release: - if: (github.event.release.tag_name || github.event.inputs.version) != '' + if: env.VOICEVOX_ENGINE_VERSION != '' needs: [build-all] runs-on: ubuntu-latest strategy: @@ -511,9 +511,12 @@ jobs: - windows-cpu - windows-directml - windows-nvidia - env: - package_name: voicevox_engine-${{ matrix.artifact_name }}-${{ env.VOICEVOX_ENGINE_VERSION }} steps: + - name: declare variables + id: vars + run: | + echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ env.VOICEVOX_ENGINE_VERSION }}" >> $GITHUB_OUTPUT + - uses: actions/checkout@v3 - name: Install dependencies @@ -531,22 +534,22 @@ jobs: - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ env.package_name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ steps.vars.package-name }}.7z" "${{ matrix.artifact_name }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) - split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ env.package_name }}. + split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.package-name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp - if [ "$(ls ${{ env.package_name }}.*.vvpp | wc -l)" == 1 ]; then - mv ${{ env.package_name }}.001.vvpp ${{ env.package_name }}.vvpp + if [ "$(ls ${{ steps.vars.package-name }}.*.vvpp | wc -l)" == 1 ]; then + mv ${{ steps.vars.package-name }}.001.vvpp ${{ steps.vars.package-name }}.vvpp fi # Output splitted archive list - ls ${{ env.package_name }}.7z.* > archives_7z.txt - mv archives_7z.txt "${{ env.package_name }}.7z.txt" - ls ${{ env.package_name }}*.vvpp > archives_vvpp.txt - mv archives_vvpp.txt "${{ env.package_name }}.vvpp.txt" + ls ${{ steps.vars.package-name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ steps.vars.package-name }}.7z.txt" + ls ${{ steps.vars.package-name }}*.vvpp > archives_vvpp.txt + mv archives_vvpp.txt "${{ steps.vars.package-name }}.vvpp.txt" - name: Upload splitted archives to Release assets uses: softprops/action-gh-release@v1 @@ -554,15 +557,15 @@ jobs: prerelease: ${{ github.event.inputs.prerelease }} tag_name: ${{ env.VOICEVOX_ENGINE_VERSION }} files: |- - ${{ env.package_name }}.7z.* - ${{ env.package_name }}*.vvpp - ${{ env.package_name }}.vvpp.txt + ${{ steps.vars.package-name }}.7z.* + ${{ steps.vars.package-name }}*.vvpp + ${{ steps.vars.package-name }}.vvpp.txt target_commitish: ${{ github.sha }} run-release-test-workflow: - if: (github.event.release.tag_name || github.event.inputs.version) != '' + if: env.VOICEVOX_ENGINE_VERSION != '' needs: [upload-to-release] uses: ./.github/workflows/release-test.yml with: - version: ${{ github.event.release.tag_name || github.event.inputs.version }} # env.VOICEVOX_ENGINE_VERSIONが使えない + version: ${{ env.VOICEVOX_ENGINE_VERSION }} repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index a49801a4b..62f510a2f 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -43,10 +43,18 @@ jobs: target: windows-cpu - os: windows-2019 target: windows-nvidia + - os: windows-2019 + target: windows-directml runs-on: ${{ matrix.os }} steps: + - 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 + - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -56,12 +64,10 @@ jobs: - name: Download shell: bash -euxv {0} - env: - RELEASE_URL: ${{ env.REPO_URL }}/releases/download/${{ env.VERSION }} run: | mkdir -p download - curl -L -o "download/list.txt" "${{ env.RELEASE_URL }}/${{ matrix.target }}.7z.txt" - cat "download/list.txt" | xargs -I '%' curl -L -o "download/%" "${{ env.RELEASE_URL }}/%" + curl -L -o "download/list.txt" "${{ steps.vars.release-url }}/${{ steps.vars.package-name }}.7z.txt" + cat "download/list.txt" | xargs -I '%' curl -L -o "download/%" "${{ steps.vars.release-url }}/%" 7z x "download/$(head -n1 download/list.txt)" mv ${{ matrix.target }} dist/ From 0ac4e8c1c78c9726cd668bd64651c6975679d8bf Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 17:10:25 +0000 Subject: [PATCH 04/14] is this ok? --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dad99e5c9..c989fa0ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -511,11 +511,14 @@ jobs: - windows-cpu - windows-directml - windows-nvidia + outputs: + voicevox-engine-version: ${{ steps.vars.voicevox-engine-version }} steps: - name: declare variables id: vars run: | echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ env.VOICEVOX_ENGINE_VERSION }}" >> $GITHUB_OUTPUT + echo "voicevox-engine-version={{ env.VOICEVOX_ENGINE_VERSION }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -567,5 +570,5 @@ jobs: needs: [upload-to-release] uses: ./.github/workflows/release-test.yml with: - version: ${{ env.VOICEVOX_ENGINE_VERSION }} + version: ${{ needs.upload-to-release.outputs.voicevox-engine-version }} repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL From 952854589f7eee3d882677e3420a3dcce129c7fb Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 17:18:29 +0000 Subject: [PATCH 05/14] no more env --- .github/workflows/build.yml | 39 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c989fa0ff..d39f2b61f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,16 +20,24 @@ on: type: boolean env: - IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine PYTHON_VERSION: "3.8.10" VOICEVOX_RESOURCE_VERSION: "0.13.3" VOICEVOX_CORE_VERSION: "0.14.0-preview.2" - VOICEVOX_ENGINE_VERSION: - |- # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列. - ${{ github.event.release.tag_name || github.event.inputs.version }} jobs: + config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. + uses: ubuntu-latest + outputs: + voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} + steps: + - name: declare variables + id: vars + run: | + : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列. + echo "voicevox-engine-version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT + build-all: + needs: [config] environment: ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment strategy: matrix: @@ -391,11 +399,11 @@ jobs: # Replace version & specify dynamic libraries if [[ ${{ matrix.os }} == macos-* ]]; then - gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION || 'latest' }}\"/" voicevox_engine/__init__.py + gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version || 'latest' }}\"/" voicevox_engine/__init__.py LIBCORE_PATH=download/core/libvoicevox_core.dylib LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib else - sed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION || 'latest' }}\"/" voicevox_engine/__init__.py + sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version || 'latest' }}\"/" voicevox_engine/__init__.py if [[ ${{ matrix.os }} == windows-* ]]; then LIBCORE_PATH=download/core/voicevox_core.dll LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll @@ -493,14 +501,14 @@ jobs: uses: actions/upload-artifact@v3 # env: # VERSIONED_ARTIFACT_NAME: | - # ${{ format('{0}-{1}', matrix.artifact_name, (env.VOICEVOX_ENGINE_VERSION != 'latest' && env.VOICEVOX_ENGINE_VERSION) || github.sha) }} + # ${{ format('{0}-{1}', matrix.artifact_name, (needs.config.outputs.voicevox-engine-version != 'latest' && needs.config.outputs.voicevox-engine-version) || github.sha) }} with: name: ${{ matrix.artifact_name }} path: dist/run/ upload-to-release: - if: env.VOICEVOX_ENGINE_VERSION != '' - needs: [build-all] + if: needs.config.outputs.voicevox-engine-version != '' + needs: [config, build-all] runs-on: ubuntu-latest strategy: matrix: @@ -511,14 +519,11 @@ jobs: - windows-cpu - windows-directml - windows-nvidia - outputs: - voicevox-engine-version: ${{ steps.vars.voicevox-engine-version }} steps: - name: declare variables id: vars run: | - echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ env.VOICEVOX_ENGINE_VERSION }}" >> $GITHUB_OUTPUT - echo "voicevox-engine-version={{ env.VOICEVOX_ENGINE_VERSION }}" >> $GITHUB_OUTPUT + echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -558,7 +563,7 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: ${{ github.event.inputs.prerelease }} - tag_name: ${{ env.VOICEVOX_ENGINE_VERSION }} + tag_name: ${{ needs.config.outputs.voicevox-engine-version }} files: |- ${{ steps.vars.package-name }}.7z.* ${{ steps.vars.package-name }}*.vvpp @@ -566,9 +571,9 @@ jobs: target_commitish: ${{ github.sha }} run-release-test-workflow: - if: env.VOICEVOX_ENGINE_VERSION != '' - needs: [upload-to-release] + if: needs.config.outputs.voicevox-engine-version != '' + needs: [config, upload-to-release] uses: ./.github/workflows/release-test.yml with: - version: ${{ needs.upload-to-release.outputs.voicevox-engine-version }} + version: ${{ needs.config.outputs.voicevox-engine-version }} repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL From 6175212a14e00387fd62a1214bffbaa6907fa13d Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 17:19:28 +0000 Subject: [PATCH 06/14] fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d39f2b61f..0f627732b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ env: jobs: config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. - uses: ubuntu-latest + runs-on: ubuntu-latest outputs: voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} steps: From 22e7ceacfed35d32ec6f45f75099d5afc5646442 Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 17:50:23 +0000 Subject: [PATCH 07/14] fix --- .github/workflows/build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f627732b..95aa8ebf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. runs-on: ubuntu-latest outputs: - voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} + voicevox-engine-version: ${{ steps.outputs.vars.outputs.voicevox-engine-version }} steps: - name: declare variables id: vars @@ -542,22 +542,22 @@ jobs: - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ steps.vars.package-name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ steps.outputs.vars.package-name }}.7z" "${{ matrix.artifact_name }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) - split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.package-name }}. + split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.outputs.vars.package-name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp - if [ "$(ls ${{ steps.vars.package-name }}.*.vvpp | wc -l)" == 1 ]; then - mv ${{ steps.vars.package-name }}.001.vvpp ${{ steps.vars.package-name }}.vvpp + if [ "$(ls ${{ steps.outputs.vars.package-name }}.*.vvpp | wc -l)" == 1 ]; then + mv ${{ steps.outputs.vars.package-name }}.001.vvpp ${{ steps.outputs.vars.package-name }}.vvpp fi # Output splitted archive list - ls ${{ steps.vars.package-name }}.7z.* > archives_7z.txt - mv archives_7z.txt "${{ steps.vars.package-name }}.7z.txt" - ls ${{ steps.vars.package-name }}*.vvpp > archives_vvpp.txt - mv archives_vvpp.txt "${{ steps.vars.package-name }}.vvpp.txt" + ls ${{ steps.outputs.vars.package-name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ steps.outputs.vars.package-name }}.7z.txt" + ls ${{ steps.outputs.vars.package-name }}*.vvpp > archives_vvpp.txt + mv archives_vvpp.txt "${{ steps.outputs.vars.package-name }}.vvpp.txt" - name: Upload splitted archives to Release assets uses: softprops/action-gh-release@v1 @@ -565,9 +565,9 @@ jobs: prerelease: ${{ github.event.inputs.prerelease }} tag_name: ${{ needs.config.outputs.voicevox-engine-version }} files: |- - ${{ steps.vars.package-name }}.7z.* - ${{ steps.vars.package-name }}*.vvpp - ${{ steps.vars.package-name }}.vvpp.txt + ${{ steps.outputs.vars.package-name }}.7z.* + ${{ steps.outputs.vars.package-name }}*.vvpp + ${{ steps.outputs.vars.package-name }}.vvpp.txt target_commitish: ${{ github.sha }} run-release-test-workflow: From a5b437e89b4154bfba9392d89f7066381e78af6b Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 18:05:25 +0000 Subject: [PATCH 08/14] fix... --- .github/workflows/build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95aa8ebf6..38160d9f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. runs-on: ubuntu-latest outputs: - voicevox-engine-version: ${{ steps.outputs.vars.outputs.voicevox-engine-version }} + voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} steps: - name: declare variables id: vars @@ -542,22 +542,22 @@ jobs: - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ steps.outputs.vars.package-name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ steps.vars.outputs.package-name }}.7z" "${{ matrix.artifact_name }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) - split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.outputs.vars.package-name }}. + split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.outputs.package-name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp - if [ "$(ls ${{ steps.outputs.vars.package-name }}.*.vvpp | wc -l)" == 1 ]; then - mv ${{ steps.outputs.vars.package-name }}.001.vvpp ${{ steps.outputs.vars.package-name }}.vvpp + if [ "$(ls ${{ steps.vars.outputs.package-name }}.*.vvpp | wc -l)" == 1 ]; then + mv ${{ steps.vars.outputs.package-name }}.001.vvpp ${{ steps.vars.outputs.package-name }}.vvpp fi # Output splitted archive list - ls ${{ steps.outputs.vars.package-name }}.7z.* > archives_7z.txt - mv archives_7z.txt "${{ steps.outputs.vars.package-name }}.7z.txt" - ls ${{ steps.outputs.vars.package-name }}*.vvpp > archives_vvpp.txt - mv archives_vvpp.txt "${{ steps.outputs.vars.package-name }}.vvpp.txt" + ls ${{ steps.vars.outputs.package-name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ steps.vars.outputs.package-name }}.7z.txt" + ls ${{ steps.vars.outputs.package-name }}*.vvpp > archives_vvpp.txt + mv archives_vvpp.txt "${{ steps.vars.outputs.package-name }}.vvpp.txt" - name: Upload splitted archives to Release assets uses: softprops/action-gh-release@v1 @@ -565,9 +565,9 @@ jobs: prerelease: ${{ github.event.inputs.prerelease }} tag_name: ${{ needs.config.outputs.voicevox-engine-version }} files: |- - ${{ steps.outputs.vars.package-name }}.7z.* - ${{ steps.outputs.vars.package-name }}*.vvpp - ${{ steps.outputs.vars.package-name }}.vvpp.txt + ${{ steps.vars.outputs.package-name }}.7z.* + ${{ steps.vars.outputs.package-name }}*.vvpp + ${{ steps.vars.outputs.package-name }}.vvpp.txt target_commitish: ${{ github.sha }} run-release-test-workflow: From 15bf4279d7b217451166838946be1bb6e91411bb Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 19:23:43 +0000 Subject: [PATCH 09/14] rename artifact --- .github/workflows/build.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38160d9f8..99dc56530 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,8 @@ jobs: run: | : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列. echo "voicevox-engine-version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT + : # release タグ名, または workflow_dispatch でのバージョン名, または 'latest' + echo "voicevox-engine-version-or-latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT build-all: needs: [config] @@ -87,6 +89,11 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: declare variables + id: vars + run: | + echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + - uses: actions/checkout@v3 - name: Show disk space (debug info) @@ -399,11 +406,11 @@ jobs: # Replace version & specify dynamic libraries if [[ ${{ matrix.os }} == macos-* ]]; then - gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version || 'latest' }}\"/" voicevox_engine/__init__.py + gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version-or-latest }}\"/" voicevox_engine/__init__.py LIBCORE_PATH=download/core/libvoicevox_core.dylib LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib else - sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version || 'latest' }}\"/" voicevox_engine/__init__.py + sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version-or-latest }}\"/" voicevox_engine/__init__.py if [[ ${{ matrix.os }} == windows-* ]]; then LIBCORE_PATH=download/core/voicevox_core.dll LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll @@ -503,7 +510,7 @@ jobs: # VERSIONED_ARTIFACT_NAME: | # ${{ format('{0}-{1}', matrix.artifact_name, (needs.config.outputs.voicevox-engine-version != 'latest' && needs.config.outputs.voicevox-engine-version) || github.sha) }} with: - name: ${{ matrix.artifact_name }} + name: ${{ steps.vars.outputs.artifact-name }} path: dist/run/ upload-to-release: @@ -524,6 +531,9 @@ jobs: id: vars run: | echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version }}" >> $GITHUB_OUTPUT + : # this is exactly same as `steps.vars.outputs.artifact-name` in `build-all` job, + : # but since we cannot get the job outputs of matrix builds correctly, we need to redefine here. + echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -536,7 +546,7 @@ jobs: - name: Download and extract artifact uses: actions/download-artifact@v3 with: - name: ${{ matrix.artifact_name }} + name: ${{ steps.vars.outputs.artifact-name }} path: ${{ matrix.artifact_name }}/ - name: Rearchive and split artifact From 61176bd0739fdd956fc49371b433b298a261b7ed Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 19:23:52 +0000 Subject: [PATCH 10/14] fix release-test --- .github/workflows/release-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 62f510a2f..c9faf5b81 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -66,8 +66,8 @@ jobs: shell: bash -euxv {0} run: | mkdir -p download - curl -L -o "download/list.txt" "${{ steps.vars.release-url }}/${{ steps.vars.package-name }}.7z.txt" - cat "download/list.txt" | xargs -I '%' curl -L -o "download/%" "${{ steps.vars.release-url }}/%" + 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/ From 2766dcc3a78b945908ba12ca994c406c9d1eb2e6 Mon Sep 17 00:00:00 2001 From: sarisia Date: Mon, 26 Dec 2022 19:53:33 +0000 Subject: [PATCH 11/14] force bash --- .github/workflows/build.yml | 15 +++++---------- .github/workflows/release-test.yml | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99dc56530..56a94b514 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,11 +29,13 @@ jobs: runs-on: ubuntu-latest outputs: voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} + voicevox-engine-version-or-latest: ${{ steps.vars.outputs.voicevox-engine-version-or-latest }} steps: - name: declare variables id: vars + shell: bash run: | - : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列. + : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列 echo "voicevox-engine-version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT : # release タグ名, または workflow_dispatch でのバージョン名, または 'latest' echo "voicevox-engine-version-or-latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT @@ -91,6 +93,7 @@ jobs: steps: - name: declare variables id: vars + shell: bash run: | echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT @@ -498,17 +501,8 @@ jobs: CERT_BASE64: ${{ secrets.CERT_BASE64 }} CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }} - # FIXME: versioned name may be useful; but - # actions/download-artifact and dawidd6/download-artifact do not support - # wildcard / forward-matching yet. - # Currently, It is good to use static artifact name for future binary test workflow. - # https://github.com/actions/toolkit/blob/ea81280a4d48fb0308d40f8f12ae00d117f8acb9/packages/artifact/src/internal/artifact-client.ts#L147 - # https://github.com/dawidd6/action-download-artifact/blob/af92a8455a59214b7b932932f2662fdefbd78126/main.js#L113 - name: Upload artifact uses: actions/upload-artifact@v3 - # env: - # VERSIONED_ARTIFACT_NAME: | - # ${{ format('{0}-{1}', matrix.artifact_name, (needs.config.outputs.voicevox-engine-version != 'latest' && needs.config.outputs.voicevox-engine-version) || github.sha) }} with: name: ${{ steps.vars.outputs.artifact-name }} path: dist/run/ @@ -529,6 +523,7 @@ jobs: steps: - name: declare variables id: vars + shell: bash run: | echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version }}" >> $GITHUB_OUTPUT : # this is exactly same as `steps.vars.outputs.artifact-name` in `build-all` job, diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index c9faf5b81..ae6443872 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -51,6 +51,7 @@ jobs: steps: - name: declare variables id: vars + shell: bash run: | echo "release-url=${{ env.REPO_URL }}/releases/download/${{ env.VERSION }}" >> $GITHUB_OUTPUT echo "package-name=voicevox_engine-${{ matrix.target }}-${{ env.VERSION }}" >> $GITHUB_OUTPUT From a2f3fc95d3445de3c9e80ddaf91b6353ebba0be7 Mon Sep 17 00:00:00 2001 From: sarisia Date: Thu, 29 Dec 2022 09:35:54 +0000 Subject: [PATCH 12/14] voicevox-engine-version -> version also voicevox-engine-version-or-latest -> version-or-latest --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56a94b514..95c624a1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,17 +28,17 @@ jobs: config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる. runs-on: ubuntu-latest outputs: - voicevox-engine-version: ${{ steps.vars.outputs.voicevox-engine-version }} - voicevox-engine-version-or-latest: ${{ steps.vars.outputs.voicevox-engine-version-or-latest }} + version: ${{ steps.vars.outputs.version }} + version-or-latest: ${{ steps.vars.outputs.version-or-latest }} steps: - name: declare variables id: vars shell: bash run: | : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列 - echo "voicevox-engine-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 "voicevox-engine-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-all: needs: [config] @@ -95,7 +95,7 @@ jobs: id: vars shell: bash run: | - echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -409,11 +409,11 @@ jobs: # Replace version & specify dynamic libraries if [[ ${{ matrix.os }} == macos-* ]]; then - gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version-or-latest }}\"/" voicevox_engine/__init__.py + gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version-or-latest }}\"/" voicevox_engine/__init__.py LIBCORE_PATH=download/core/libvoicevox_core.dylib LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib else - sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.voicevox-engine-version-or-latest }}\"/" voicevox_engine/__init__.py + sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version-or-latest }}\"/" voicevox_engine/__init__.py if [[ ${{ matrix.os }} == windows-* ]]; then LIBCORE_PATH=download/core/voicevox_core.dll LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll @@ -508,7 +508,7 @@ jobs: path: dist/run/ upload-to-release: - if: needs.config.outputs.voicevox-engine-version != '' + if: needs.config.outputs.version != '' needs: [config, build-all] runs-on: ubuntu-latest strategy: @@ -525,10 +525,10 @@ jobs: id: vars shell: bash run: | - echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version }}" >> $GITHUB_OUTPUT + echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT : # this is exactly same as `steps.vars.outputs.artifact-name` in `build-all` job, : # but since we cannot get the job outputs of matrix builds correctly, we need to redefine here. - echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.voicevox-engine-version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -568,7 +568,7 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: ${{ github.event.inputs.prerelease }} - tag_name: ${{ needs.config.outputs.voicevox-engine-version }} + tag_name: ${{ needs.config.outputs.version }} files: |- ${{ steps.vars.outputs.package-name }}.7z.* ${{ steps.vars.outputs.package-name }}*.vvpp @@ -576,9 +576,9 @@ jobs: target_commitish: ${{ github.sha }} run-release-test-workflow: - if: needs.config.outputs.voicevox-engine-version != '' + if: needs.config.outputs.version != '' needs: [config, upload-to-release] uses: ./.github/workflows/release-test.yml with: - version: ${{ needs.config.outputs.voicevox-engine-version }} + version: ${{ needs.config.outputs.version }} repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL From 3a294829d3495d82a38fd27b9a70773e1b56954e Mon Sep 17 00:00:00 2001 From: sarisia Date: Thu, 29 Dec 2022 09:41:16 +0000 Subject: [PATCH 13/14] kebab-case -> snake_case --- .github/workflows/build.yml | 42 +++++++++++++++--------------- .github/workflows/release-test.yml | 8 +++--- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95c624a1d..da6f2efa9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.vars.outputs.version }} - version-or-latest: ${{ steps.vars.outputs.version-or-latest }} + version_or_latest: ${{ steps.vars.outputs.version_or_latest }} steps: - name: declare variables id: vars @@ -38,7 +38,7 @@ jobs: : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列 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-all: needs: [config] @@ -95,7 +95,7 @@ jobs: id: vars shell: bash run: | - echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -409,11 +409,11 @@ jobs: # Replace version & specify dynamic libraries if [[ ${{ matrix.os }} == macos-* ]]; then - gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version-or-latest }}\"/" voicevox_engine/__init__.py + gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py LIBCORE_PATH=download/core/libvoicevox_core.dylib LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib else - sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version-or-latest }}\"/" voicevox_engine/__init__.py + sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py if [[ ${{ matrix.os }} == windows-* ]]; then LIBCORE_PATH=download/core/voicevox_core.dll LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll @@ -504,7 +504,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: ${{ steps.vars.outputs.artifact-name }} + name: ${{ steps.vars.outputs.artifact_name }} path: dist/run/ upload-to-release: @@ -525,10 +525,10 @@ jobs: id: vars shell: bash run: | - echo "package-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT - : # this is exactly same as `steps.vars.outputs.artifact-name` in `build-all` job, + echo "package_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT + : # this is exactly same as `steps.vars.outputs.artifact_name` in `build-all` job, : # but since we cannot get the job outputs of matrix builds correctly, we need to redefine here. - echo "artifact-name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version-or-latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -541,28 +541,28 @@ jobs: - name: Download and extract artifact uses: actions/download-artifact@v3 with: - name: ${{ steps.vars.outputs.artifact-name }} + name: ${{ steps.vars.outputs.artifact_name }} path: ${{ matrix.artifact_name }}/ - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ steps.vars.outputs.package-name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.artifact_name }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) - split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.outputs.package-name }}. + split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.outputs.package_name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp - if [ "$(ls ${{ steps.vars.outputs.package-name }}.*.vvpp | wc -l)" == 1 ]; then - mv ${{ steps.vars.outputs.package-name }}.001.vvpp ${{ steps.vars.outputs.package-name }}.vvpp + if [ "$(ls ${{ steps.vars.outputs.package_name }}.*.vvpp | wc -l)" == 1 ]; then + mv ${{ steps.vars.outputs.package_name }}.001.vvpp ${{ steps.vars.outputs.package_name }}.vvpp fi # Output splitted archive list - ls ${{ steps.vars.outputs.package-name }}.7z.* > archives_7z.txt - mv archives_7z.txt "${{ steps.vars.outputs.package-name }}.7z.txt" - ls ${{ steps.vars.outputs.package-name }}*.vvpp > archives_vvpp.txt - mv archives_vvpp.txt "${{ steps.vars.outputs.package-name }}.vvpp.txt" + ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt + mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt" + ls ${{ steps.vars.outputs.package_name }}*.vvpp > archives_vvpp.txt + mv archives_vvpp.txt "${{ steps.vars.outputs.package_name }}.vvpp.txt" - name: Upload splitted archives to Release assets uses: softprops/action-gh-release@v1 @@ -570,9 +570,9 @@ jobs: prerelease: ${{ github.event.inputs.prerelease }} tag_name: ${{ needs.config.outputs.version }} files: |- - ${{ steps.vars.outputs.package-name }}.7z.* - ${{ steps.vars.outputs.package-name }}*.vvpp - ${{ steps.vars.outputs.package-name }}.vvpp.txt + ${{ steps.vars.outputs.package_name }}.7z.* + ${{ steps.vars.outputs.package_name }}*.vvpp + ${{ steps.vars.outputs.package_name }}.vvpp.txt target_commitish: ${{ github.sha }} run-release-test-workflow: diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index ae6443872..b1ccb29f0 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -53,8 +53,8 @@ jobs: id: vars shell: bash 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@v2 @@ -67,8 +67,8 @@ jobs: shell: bash -euxv {0} run: | mkdir -p download - 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 }}/%" + 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/ From 685ffc1d41fab95ad1f9adc4098da5e7a4eda39d Mon Sep 17 00:00:00 2001 From: sarisia Date: Thu, 29 Dec 2022 12:22:45 +0000 Subject: [PATCH 14/14] matrix.artifact_name -> matrix.target --- .github/workflows/build.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da6f2efa9..df8bb449e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,14 +51,14 @@ jobs: architecture: "x64" voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-1.13.1.zip - artifact_name: windows-cpu + target: windows-cpu # Windows DirectML - os: windows-2019 architecture: "x64" voicevox_core_asset_prefix: voicevox_core-windows-x64-directml onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/Microsoft.ML.OnnxRuntime.DirectML.1.13.1.zip directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.10.0 - artifact_name: windows-directml + target: windows-directml # Windows NVIDIA GPU - os: windows-2019 architecture: "x64" @@ -66,19 +66,19 @@ jobs: onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-gpu-1.13.1.zip cuda_version: "11.6.2" cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-windows-x86_64-8.4.1.50_cuda11.6-archive.zip - artifact_name: windows-nvidia + target: windows-nvidia # Mac CPU (x64 arch only) - os: macos-11 architecture: "x64" voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-x86_64-1.13.1.tgz - artifact_name: macos-x64 + target: macos-x64 # Linux CPU - os: ubuntu-20.04 architecture: "x64" voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz - artifact_name: linux-cpu + target: linux-cpu # Linux NVIDIA GPU - os: ubuntu-20.04 architecture: "x64" @@ -86,7 +86,7 @@ jobs: onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz cuda_version: "11.6.2" cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz - artifact_name: linux-nvidia + target: linux-nvidia runs-on: ${{ matrix.os }} @@ -95,7 +95,7 @@ jobs: id: vars shell: bash run: | - echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -114,7 +114,7 @@ jobs: # ONNX Runtime providersとCUDA周りをリンクするために使う - name: Install patchelf - if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia') + if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia') run: | sudo apt-get update sudo apt-get install -y patchelf @@ -265,12 +265,12 @@ jobs: # Donwload DirectML - name: Export DirectML url to calc hash - if: endswith(matrix.artifact_name, '-directml') + if: endswith(matrix.target, '-directml') shell: bash run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt - name: Cache DirectML - if: endswith(matrix.artifact_name, '-directml') + if: endswith(matrix.target, '-directml') uses: actions/cache@v3 id: directml-cache with: @@ -278,7 +278,7 @@ jobs: path: download/directml - name: Download DirectML - if: steps.directml-cache.outputs.cache-hit != 'true' && endswith(matrix.artifact_name, '-directml') + if: steps.directml-cache.outputs.cache-hit != 'true' && endswith(matrix.target, '-directml') shell: bash run: | curl -L "${{ matrix.directml_url }}" -o download/directml.zip @@ -309,7 +309,7 @@ jobs: curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip # extract only dlls - if [[ ${{ matrix.artifact_name }} != *-directml ]]; then + if [[ ${{ matrix.target }} != *-directml ]]; then unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/ mv download/onnxruntime-* download/onnxruntime else @@ -461,13 +461,13 @@ jobs: ln -sf "$(pwd)/download/cudnn/bin"/cudnn_*_infer64*.dll dist/run/ fi - if [[ ${{ matrix.artifact_name }} == *-directml ]]; then + if [[ ${{ matrix.target }} == *-directml ]]; then # DirectML ln -sf "$(pwd)/download/directml"/DirectML.dll dist/run/ fi - name: Create symlink of CUDA dependencies - if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia') + if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia') shell: bash run: | set -eux @@ -513,7 +513,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - artifact_name: + target: - macos-x64 - linux-cpu - linux-nvidia @@ -525,10 +525,10 @@ jobs: id: vars shell: bash run: | - echo "package_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT + echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT : # this is exactly same as `steps.vars.outputs.artifact_name` in `build-all` job, : # but since we cannot get the job outputs of matrix builds correctly, we need to redefine here. - echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT + echo "artifact_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 @@ -542,15 +542,15 @@ jobs: uses: actions/download-artifact@v3 with: name: ${{ steps.vars.outputs.artifact_name }} - path: ${{ matrix.artifact_name }}/ + path: ${{ matrix.target }}/ - name: Rearchive and split artifact run: | # Compress to artifact.7z.001, artifact.7z.002, ... - 7z -r -v2g a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.artifact_name }}/" + 7z -r -v2g a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/" # Compress to artifact.001.vvpp,artifact.002.vvpp, ... - (cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip) + (cd "${{ matrix.target }}" && zip -r - . > ../compressed.zip) split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.outputs.package_name }}. # Rename to artifact.vvpp if there are only artifact.001.vvpp