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

リリースに sumomo バイナリを含めるようにする #158

Merged
merged 30 commits into from
Feb 7, 2025

Conversation

torikizi
Copy link
Contributor

リリース時に sumomo バイナリを含めるように build.yml を修正


This pull request includes changes to the build workflow and documentation. The most important changes involve adding a new step to download and archive example files in the build process and updating the changelog to reflect this addition.

Changes to build workflow:

  • .github/workflows/build.yml: Added a new step to download and archive example files, including specific handling for macOS and Windows examples.

Documentation updates:

  • CHANGES.md: Updated the changelog to include the addition of sumomo binaries in the release.

@torikizi torikizi requested review from melpon and miosakuma January 31, 2025 01:11
rm -rf "archive/$d/$d"
(cd archive && tar czf "../sumomo_macos_arm64.tar.gz" "$d")
echo "sumomo_macos_arm64.tar.gz" >> package_paths.env
elif [[ "$d" == *"windows"* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

プラットフォーム名に対してこういう曖昧な判定をすると、

  • この部分を見た時に実際に何のプラットフォームに引っかかるのか分からない
  • 後でプラットフォームを増やす時に既存のやつを確認しようと検索してもマッチしないからこの部分を確認できずスルーして意図しないバグを埋め込むことになる

という問題があるので、ワイルドカードを使わずに "$d" == "windows_x86_64" のような書き方をして下さい。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

プラットフォームをまとめず一つずつ書くようにしました。

elif [[ "$d" == *"windows"* ]]; then
(cd archive && zip -r "../sumomo_windows_x86_64.zip" "$d")
echo "sumomo_windows_x86_64.zip" >> package_paths.env
else
Copy link
Contributor

Choose a reason for hiding this comment

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

ここも同じ問題があるので、意図したプラットフォームを全部列挙して、意図しないプラットフォーム名が来たらエラーになるようにして下さい

Copy link
Contributor Author

Choose a reason for hiding this comment

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

バイナリを作りたいプラットフォームを書くようにし、意図しないものは無視するようにしました。

merge-multiple: false
- name: Archive Examples
run: |
for d in examples_*; do
Copy link
Contributor

Choose a reason for hiding this comment

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

d という名前が分かりにくいのでちゃんとした名前を指定して下さい。
また、ワイルドカードで列挙すると一覧性が悪くなるので、以下のようにして下さい。

Suggested change
for d in examples_*; do
for platform in \
windows_x86_64 \
macos_arm64 \
ubuntu-20.04_x86_64 \
ubuntu-22.04_x86_64 \
ubuntu-24.04_x86_64 \
ubuntu-24.04_armv8; do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

d を使用することをやめました。

(cd archive && tar czf "../sumomo_macos_arm64.tar.gz" "$d")
echo "sumomo_macos_arm64.tar.gz" >> package_paths.env
elif [[ "$d" == *"windows"* ]]; then
(cd archive && zip -r "../sumomo_windows_x86_64.zip" "$d")
Copy link
Contributor

Choose a reason for hiding this comment

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

このままだと全部の examples バイナリが含まれてそう

Copy link
Contributor Author

Choose a reason for hiding this comment

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

バイナリ格納方法を見直しました。

run: |
for d in examples_*; do
mkdir -p "archive/$d"
mv "$d" "archive/$d/"
Copy link
Contributor

Choose a reason for hiding this comment

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

入力となるディレクトリと、そこから sumomo を取り出して配置するディレクトリが同じ場所にあると分かりにくいので、わざわざ mv しなくて良いです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mv を削除しました

(cd archive && zip -r "../sumomo_windows_x86_64.zip" "$d")
echo "sumomo_windows_x86_64.zip" >> package_paths.env
else
(cd archive && tar czf "../sumomo_${d#examples_}.tar.gz" "$d")
Copy link
Contributor

Choose a reason for hiding this comment

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

このままだと全部の examples バイナリが含まれてそう

Copy link
Contributor Author

Choose a reason for hiding this comment

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

バイナリ格納方法を見直しました。

@torikizi
Copy link
Contributor Author

torikizi commented Feb 1, 2025

レビューありがとうございます。$d やサブシェルなどの処理を見直し、シンプルにしました。
コメントも増やしました。

@torikizi
Copy link
Contributor Author

torikizi commented Feb 1, 2025

レビューしていただいているところですが、もう少し見直しをしたいため WIP にします。

@torikizi torikizi changed the title リリースに sumomo バイナリを含めるようにする [WIP] リリースに sumomo バイナリを含めるようにする Feb 1, 2025
@@ -82,20 +82,6 @@ jobs:
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/sora.env
# Examples のビルド
Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples のビルドをわけました。 SDK のビルドの中では行わないようにします。

Copy link
Contributor

Choose a reason for hiding this comment

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

example 自体のビルドは、ビルドが通ることを確認するためにも必要です。
リリース時にしかビルドしないとリリース時に初めてビルドエラーに気が付くみたいなことになるし、そもそも今はリリース時に sumomo しかビルドしてないから、ほかのサンプルのビルドが通ることを担保できなくなります。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご指摘のとおりです。
SDK ビルド時の examples のビルドはこれまで通り実施するように戻します。

.github/workflows/build.yml Outdated Show resolved Hide resolved
@torikizi torikizi changed the title [WIP] リリースに sumomo バイナリを含めるようにする リリースに sumomo バイナリを含めるようにする Feb 5, 2025
@torikizi
Copy link
Contributor Author

torikizi commented Feb 5, 2025

WIP を解除しました。レビューよろしくお願いします。

@torikizi
Copy link
Contributor Author

torikizi commented Feb 5, 2025

変更履歴と build.yml を修正しました。
改めてレビューをお願いします。

@@ -82,20 +82,6 @@ jobs:
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/sora.env
# Examples のビルド
Copy link
Contributor

Choose a reason for hiding this comment

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

example 自体のビルドは、ビルドが通ることを確認するためにも必要です。
リリース時にしかビルドしないとリリース時に初めてビルドエラーに気が付くみたいなことになるし、そもそも今はリリース時に sumomo しかビルドしてないから、ほかのサンプルのビルドが通ることを担保できなくなります。

- uses: actions/checkout@v4
# Select Xcode 15.4(build-macosと同じバージョンを使う)
- name: Select Xcode 15.4
run: sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
Copy link
Contributor

Choose a reason for hiding this comment

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

これ必要なのかな…。(入れた経緯がよく分かってない。 shiguredo-webrtc-build/webrtc-build@8d3a781 が大元のコミットっぽい)
変わるたびにバージョン指定をするの大変そうだし、いい感じに設定できるか、設定を無くせると良さそうな気がする。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

必要かどうかを見直して対応します。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

こちらは導入時に原因となったロジックが削除されていました。削除してビルドが通ることも確認しており、不要と判断して削除します。
差分

.github/workflows/build.yml Show resolved Hide resolved
- name: Upload Examples Artifact
uses: actions/upload-artifact@v4
with:
# .tar.gz まで含めないとアップロード時には設定されない
Copy link
Contributor

Choose a reason for hiding this comment

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

このコメントを書く意味がちょっと分かりませんでした。
name で指定した名前は download-artifact で引っ張ってくる時に利用する名前というだけなので、アーティファクト間で一意であれば何でも良いはずで、アップロードしたアーティファクト名に拡張子が含まれてるかどうかは別に重要ではないです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

元々は SDK ビルド時に作成される examples_ に拡張子が入っていなかったのでわかるようにしたほうが良いと考えていれたコメントでした。
ビルドパッケージを作成する場所でファイルの例も載せているのでここにこのコメントは不要でした。

- uses: actions/download-artifact@v4
with:
name: ${{ matrix.example.name }}_${{ matrix.platform.name }}.${{ matrix.platform.file_ext }}
# GitHub Releaseを作成し、Examplesをアップロード
Copy link
Contributor

Choose a reason for hiding this comment

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

リリース自体は既に作られてるので、単にリリースアセットを増やすだけのはず

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ご指摘のとおりです。
ここはたんにリリースしているだけになりますのでコメントが間違っていました。
先の # ビルドした Examples のアーティファクトをダウンロード も含めてここは違うコメントか無くすようにします。

CHANGES.md Outdated Show resolved Hide resolved
@torikizi
Copy link
Contributor Author

torikizi commented Feb 7, 2025

ご指摘いただいた内容について対応完了しました。CI も通っているのを確認しました。

CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
@torikizi
Copy link
Contributor Author

torikizi commented Feb 7, 2025

動作確認もできました。こちらマージします。
レビューありがとうございました

@torikizi torikizi merged commit 6f96d8d into develop Feb 7, 2025
14 checks passed
@torikizi torikizi deleted the feature/add-sumomo-release-build-binary branch February 7, 2025 04:01
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.

3 participants