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

build.ymlのbuild部分とupload部分を一貫させる #1257

Merged

Conversation

Hiroshiba
Copy link
Member

内容

を一旦完了させるタスクです。

build.yml内に書かれていた多段のjobが、これで1つのjobになります。

artifactにアップロード・ダウンロードする工程がなくなり、遅いjobを待つこともないため全体的に早くなりました。

以前のAction(54min)
https://github.com/Hiroshiba/voicevox/actions/runs/4454000489

PRのActoin(26min)
https://github.com/Hiroshiba/voicevox/actions/runs/4455163321

関連 Issue

close #837

その他

実際にRelease assetsを作ってみたのの比較です。
以前の https://github.com/Hiroshiba/voicevox/releases/tag/0.15.0-noreleasejob
PRの https://github.com/Hiroshiba/voicevox/releases/tag/0.15.0-noreleasejob.2

実際にどちらもダウンロードしてアーカイブファイルを展開し、ファイル名が一致することを確認しました。

確認コード
set -eux

# Setup variables
repo="Hiroshiba/voicevox"
tag1="0.15.0-noreleasejob"
tag2="0.15.0-noreleasejob.2"

# Download assets
gh release download $tag1 --repo $repo --dir assets1
gh release download $tag2 --repo $repo --dir assets2

# Extract tar.gz and zip files
for archive in $(find assets1 -name '*.tar.gz' -o -name '*.zip'); do
    dest="assets1/$(basename "$archive")_extracted"
    mkdir -p "$dest"
    [[ $archive =~ \.tar\.gz$ ]] && tar -xzf "$archive" -C "$dest"
    [[ $archive =~ \.zip$ ]] && unzip "$archive" -d "$dest"
done

for archive in $(find assets2 -name '*.tar.gz' -o -name '*.zip'); do
    dest="assets2/$(basename "$archive")_extracted"
    mkdir -p "$dest"
    [[ $archive =~ \.tar\.gz$ ]] && tar -xzf "$archive" -C "$dest"
    [[ $archive =~ \.zip$ ]] && unzip "$archive" -d "$dest"
done

# nvidia linux tar.gzはなくなったので除外
rm assets1/voicevox-linux-nvidia-$tag1.tar.gz

# Compare contents
diff \
    <(
        find assets1 -type f -printf '%P\n' | sed -r "s/$tag1/assetname/g" | sort
    ) \
    <(
        find assets2 -type f -printf '%P\n' | sed -r "s/$tag2/assetname/g" | sort
    ) |
    tee result.txt

@y-chan メンテナ共有です。
linux-nvidiaのtar.gzがほぼほぼ2GBになっていて、次のアップデートのときに容量オーバーになりそうだったので、ついでにアップロードしないようにしてみました。
もともとたまに容量オーバーしていたのでVOICEVOXページからのリンクは省いていたのもあって、あまり問題ないかなと思ってますがどうでしょう 👀
image

@Hiroshiba Hiroshiba requested a review from a team as a code owner March 19, 2023 13:57
@Hiroshiba Hiroshiba requested review from y-chan and removed request for a team March 19, 2023 13:57
@@ -440,21 +470,53 @@ jobs:
run: |
df -h

- name: Upload Linux AppImage artifact
- name: Create Linux AppImage splitted
Copy link
Member Author

Choose a reason for hiding this comment

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

もともとはbuild.yml側でAppImageを作ってupload側でsplitしていたのを、どちらもここで行うように変更しました

Copy link
Member Author

Choose a reason for hiding this comment

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

こういう便利Action、別リポジトリで持っておいてVOICEVOX Org内の他からも気軽に使えるようにしたいかも。

Copy link
Member

@y-chan y-chan left a comment

Choose a reason for hiding this comment

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

LGTM!

typoと表記が気になったのでコメントしました!
最低限typoを直してマージで良いと思います...!

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/actions/upload-release-and-artifact/action.yml Outdated Show resolved Hide resolved
@y-chan
Copy link
Member

y-chan commented Mar 19, 2023

すみません、メンテナ判断的なところに返事できていませんでした...
linux-nvidiaのメンテをやめるのは、公式サイトで案内していないという点からも特に問題ないと思います...!
もし、今後配布してほしいと行った意見が出た場合は、7zとかなら配布再開を検討してもいいかもですが、需要は少ないと思うので、優先度低めで良いと思います。

Hiroshiba and others added 3 commits March 20, 2023 01:15
Comment on lines +19 to +20
with:
files: ". .github"
Copy link
Member Author

Choose a reason for hiding this comment

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

@y-chan typosが.githubに対して働いていなかったので追加してみました。
ほんとは_typos.toml側にこの設定を追加しておくと再利用性が上がって便利そうですが、なかったのでこっちに。。

@Hiroshiba
Copy link
Member Author

問題ないと思うのでマージします!

typosは一般化して全リポジトリから良い感じに使えるように切り出したいですね・・・

@Hiroshiba Hiroshiba merged commit 2cfda67 into VOICEVOX:main Mar 22, 2023
@Hiroshiba Hiroshiba deleted the upload-distributable-to-releaseを解体 branch March 22, 2023 20:14
Comment on lines +33 to +49
runs:
using: "composite"
steps:
- name: Upload to Artifacts
if: inputs.artifact_name != ''
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: ${{ inputs.files }}

- name: Upload to Release Assets
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ inputs.prerelease }}
tag_name: ${{ inputs.tag_name }}
files: ${{ inputs.files }}
target_commitish: ${{ inputs.target_commitish }}
Copy link
Member Author

Choose a reason for hiding this comment

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

upload_releaseupload_artifactのフラグが使われてない!

Copy link
Member Author

Choose a reason for hiding this comment

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

修正PR出しました #1261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github Actionsでのビルドのupload/download回数を少なくしてビルド時間を短くする
2 participants