Skip to content

Commit 8e3f22c

Browse files
committed
SDK バージョン情報を取得するジョブを追加し、ビルドプロセスを改善する
1 parent 4ec17cf commit 8e3f22c

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ env:
2626
OPENH264_VERSION: 2.6.0
2727

2828
jobs:
29+
# VERSION ファイルからバージョン情報を取得
30+
get_sdk_version:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
version: ${{ steps.version.outputs.version }}
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
sparse-checkout: |
38+
VERSION
39+
sparse-checkout-cone-mode: false
40+
- id: version
41+
run: |
42+
VERSION=$(cat VERSION)
43+
echo "version=$VERSION" >> $GITHUB_OUTPUT
44+
echo "SDK Version: $VERSION"
45+
2946
# まず pyi を生成する
3047
# クロスコンパイル環境だと pyi が生成できないので、
3148
# 1箇所で pyi を生成してアーティファクトにアップロードして、
@@ -168,37 +185,24 @@ jobs:
168185
pkg: "312"
169186
- python: "3.13"
170187
pkg: "313"
171-
needs: [build_ubuntu]
188+
needs: [get_sdk_version, build_ubuntu]
172189
runs-on: ${{ matrix.platform.runs_on }}
173190
timeout-minutes: 15
174191
steps:
175-
- uses: actions/checkout@v4
176192
- uses: astral-sh/setup-uv@v6
177193
with:
178194
enable-cache: false
179-
- run: |
180-
uv python pin ${{ matrix.version.python }}
181195
- uses: actions/download-artifact@v4
182196
with:
183197
name: ${{ matrix.platform.download_name }}_python-${{ matrix.version.python }}
184198
path: dist/
185199

186-
# VERSION ファイルからバージョンを取得
187-
- id: get_version
188-
run: |
189-
VERSION=$(cat VERSION)
190-
echo "version=$VERSION" >> $GITHUB_OUTPUT
191-
192200
# ここで download した whl ファイルの動作を確認する
193201
- run: |
194-
# 一時ディレクトリで仮想環境を作成してテスト
195-
TMPDIR=$(mktemp -d)
196-
cd $TMPDIR
202+
# 仮想環境を作成してテスト
197203
uv venv --python ${{ matrix.version.python }}
198-
uv pip install $GITHUB_WORKSPACE/dist/sora_sdk-${{ steps.get_version.outputs.version }}-cp${{ matrix.version.pkg }}-cp${{ matrix.version.pkg }}-${{ matrix.platform.pytag }}.whl
204+
uv pip install dist/sora_sdk-${{ needs.get_sdk_version.outputs.version }}-cp${{ matrix.version.pkg }}-cp${{ matrix.version.pkg }}-${{ matrix.platform.pytag }}.whl
199205
uv run python -c "import sora_sdk; print(sora_sdk.get_video_codec_capability().to_json())"
200-
cd $GITHUB_WORKSPACE
201-
rm -rf $TMPDIR
202206
203207
build_ubuntu_arm:
204208
strategy:

0 commit comments

Comments
 (0)