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

download_testをデフォルトでprerelease込みのlatestが使われるように変更 #608

Merged
Changes from 2 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
30 changes: 17 additions & 13 deletions .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
- "Cargo.*"
- "crates/download/**"
- ".github/workflows/download_test.yml"

env:
VERSION: "prerelease-latest"
Comment on lines +12 to +13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

後々このバージョンを引数で指定可能にしたいので、workflowのenvとしてここに配置しています。


defaults:
run:
shell: bash

jobs:
download-releases:
strategy:
Expand Down Expand Up @@ -169,29 +174,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' }}
Comment on lines -172 to -175
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

元々はダウンロードされたバージョンのチェックとして使われていたのを、バージョン指定できるようにしたので、EXPECTED_VOICEVOX_CORE_VERSIONという名前からVERSIONという名前に変更しています。

steps:
- uses: actions/checkout@v3
- name: Set up Rust
if: ${{ startsWith(matrix.download_command, 'cargo ') }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前のプルリクエストで必ずcargo が入るものしかなくなっていたのに気づいたので除去

uses: ./.github/actions/rust-toolchain-from-file
- name: Get prerelease latest version
if: ${{ env.VERSION == 'prerelease-latest' }}
Comment on lines +181 to +182
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正確にはプレリリースの最新ではなく、プレリリースを含む最新なので、ちょっと名称が紛らわしいかも

run: |
VERSION=$(
curl -s https://api.github.com/repos/VOICEVOX/voicevox_core/releases \
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
-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 }}')
Expand Down