From 03529076f2fb44fd44bcb830aea1290822b63e74 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Wed, 13 Sep 2023 03:31:50 +0900 Subject: [PATCH 1/4] =?UTF-8?q?download=5Ftest=E3=82=92=E3=83=87=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AB=E3=83=88=E3=81=A7prerelease-latest=E3=81=8C?= =?UTF-8?q?=E4=BD=BF=E3=82=8F=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/download_test.yml | 36 ++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/download_test.yml b/.github/workflows/download_test.yml index 86f728d20..d033b1775 100644 --- a/.github/workflows/download_test.yml +++ b/.github/workflows/download_test.yml @@ -1,5 +1,11 @@ name: Download test workflow on: + workflow_call: + inputs: + version: + description: "テスト対象のコアのバージョン。無指定時はprerelease込みの最新release。" + type: string + required: false push: branches: - main @@ -8,9 +14,14 @@ on: - "Cargo.*" - "crates/download/**" - ".github/workflows/download_test.yml" + +env: + VERSION: ${{ inputs.version || 'prerelease-latest' }} + defaults: run: shell: bash + jobs: download-releases: strategy: @@ -169,29 +180,28 @@ jobs: open_jtalk_dic_utf_8-1.11 runs-on: ${{ matrix.os }} name: ${{ matrix.name }}-${{ matrix.os }} - env: - EXPECTED_VOICEVOX_CORE_VERSION: latest - # See https://github.com/VOICEVOX/voicevox_core/issues/310 - #EXPECTED_VOICEVOX_CORE_VERSION: ${{ matrix.expected_version || 'latest' }} steps: - uses: actions/checkout@v3 - name: Set up Rust - if: ${{ startsWith(matrix.download_command, 'cargo ') }} uses: ./.github/actions/rust-toolchain-from-file + - name: Get prerelease latest version + if: ${{ env.VERSION == 'prerelease-latest' }} + run: | + VERSION=$( + curl -s https://api.github.com/repos/VOICEVOX/voicevox_core/releases \ + -H 'authorization: Bearer ${{ github.token }}' \ + -H 'content-type: application/json' | + jq -er '.[0].tag_name' + ) + echo "VERSION=$VERSION" >> "$GITHUB_ENV" - name: Execute download command - run: ${{ matrix.download_command }} + run: ${{ matrix.download_command }} --version ${{ env.VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get latest version - if: ${{ env.EXPECTED_VOICEVOX_CORE_VERSION == 'latest' }} - run: | - echo "EXPECTED_VOICEVOX_CORE_VERSION=$(gh release view --repo VOICEVOX/voicevox_core --json 'tagName' --jq '.tagName')" >> "$GITHUB_ENV" - env: - GITHUB_TOKEN: ${{ github.token }} - name: Check downloaded version run: | [ -e "${{ matrix.download_dir }}/VERSION" ] - [ "$(cat "${{ matrix.download_dir }}/VERSION")" = "${{ env.EXPECTED_VOICEVOX_CORE_VERSION }}" ] + [ "$(cat "${{ matrix.download_dir }}/VERSION")" = "${{ env.VERSION }}" ] - name: Check downloaded files run: | mapfile -t items < <(echo -n '${{ matrix.check_items }}') From 2ee50e07cce37fe02d99ea9df9395e00eb7547f7 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Wed, 13 Sep 2023 03:55:38 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=82=92=E6=B6=88=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/download_test.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/download_test.yml b/.github/workflows/download_test.yml index d033b1775..9f3f30ea7 100644 --- a/.github/workflows/download_test.yml +++ b/.github/workflows/download_test.yml @@ -1,11 +1,5 @@ name: Download test workflow on: - workflow_call: - inputs: - version: - description: "テスト対象のコアのバージョン。無指定時はprerelease込みの最新release。" - type: string - required: false push: branches: - main @@ -16,7 +10,7 @@ on: - ".github/workflows/download_test.yml" env: - VERSION: ${{ inputs.version || 'prerelease-latest' }} + VERSION: "prerelease-latest" defaults: run: From 375212449b851eeef026fd84818eaf00620157b2 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Wed, 13 Sep 2023 04:07:17 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=8C=87=E5=AE=9A=E3=81=AE=E3=81=9F=E3=82=81=E3=81=AB?= =?UTF-8?q?=20--=20=E3=81=8C=E5=BF=85=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/download_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/download_test.yml b/.github/workflows/download_test.yml index 9f3f30ea7..43df7fd1d 100644 --- a/.github/workflows/download_test.yml +++ b/.github/workflows/download_test.yml @@ -24,7 +24,7 @@ jobs: include: - name: 通常ダウンロード os: windows-latest - download_command: cargo run -vv -p download + download_command: cargo run -vv -p download -- # バージョン指定のために -- が必要 download_dir: voicevox_core check_items: | voicevox_core.dll From 9df081e48edb2a44d62d2adb4b90af9d41ab6a7b Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 15 Sep 2023 03:14:48 +0900 Subject: [PATCH 4/4] Update .github/workflows/download_test.yml Co-authored-by: Ryo Yamashita --- .github/workflows/download_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/download_test.yml b/.github/workflows/download_test.yml index 43df7fd1d..b7885ba09 100644 --- a/.github/workflows/download_test.yml +++ b/.github/workflows/download_test.yml @@ -182,7 +182,7 @@ jobs: if: ${{ env.VERSION == 'prerelease-latest' }} run: | VERSION=$( - curl -s https://api.github.com/repos/VOICEVOX/voicevox_core/releases \ + curl -sSf https://api.github.com/repos/VOICEVOX/voicevox_core/releases \ -H 'authorization: Bearer ${{ github.token }}' \ -H 'content-type: application/json' | jq -er '.[0].tag_name'