Skip to content

Commit ea975a4

Browse files
committed
Merge branch 'release/2025.1.0'
2 parents 0461f1f + 754441b commit ea975a4

File tree

192 files changed

+22245
-13389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+22245
-13389
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
name: download-binary
2+
description: 'Download momo binary from artifacts (for develop/feature branches) or from release'
3+
4+
inputs:
5+
platform:
6+
description: 'Platform name (e.g. ubuntu-24.04_x86_64)'
7+
required: true
8+
github-token:
9+
description: 'GitHub token for API access'
10+
required: true
11+
12+
outputs:
13+
source:
14+
description: 'Source of the binary (artifact or release)'
15+
value: ${{ steps.determine_source.outputs.source }}
16+
version:
17+
description: 'Version of the downloaded binary'
18+
value: ${{ steps.get_version.outputs.version }}
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- name: Get current branch and version
24+
id: get_version
25+
run: |
26+
# VERSION ファイルからバージョンを取得
27+
VERSION=$(cat VERSION | tr -d '\n')
28+
echo "Version from VERSION file: $VERSION"
29+
echo "version=$VERSION" >> $GITHUB_OUTPUT
30+
31+
# 現在のブランチ名を取得
32+
if [ -n "${{ github.ref_name }}" ]; then
33+
BRANCH="${{ github.ref_name }}"
34+
else
35+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
36+
fi
37+
echo "Current branch: $BRANCH"
38+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
39+
shell: bash
40+
41+
- name: Determine download source
42+
id: determine_source
43+
run: |
44+
BRANCH="${{ steps.get_version.outputs.branch }}"
45+
46+
# develop または feature/ ブランチの場合
47+
if [[ "$BRANCH" == "develop" ]] || [[ "$BRANCH" == feature/* ]]; then
48+
echo "Target branch detected: $BRANCH"
49+
echo "Searching for artifacts from successful build workflow..."
50+
51+
# gh コマンドで最新の成功したビルドワークフローを探す
52+
# build.yml ワークフローの最新の成功した実行を検索
53+
RUN_ID=$(gh run list \
54+
--workflow=build.yml \
55+
--branch="$BRANCH" \
56+
--status=success \
57+
--limit=1 \
58+
--json databaseId \
59+
--jq '.[0].databaseId' 2>/dev/null || echo "")
60+
61+
if [ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ]; then
62+
echo "Found successful build run: $RUN_ID"
63+
echo "source=artifact" >> $GITHUB_OUTPUT
64+
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
65+
else
66+
echo "No successful build found for branch $BRANCH, will use release"
67+
echo "source=release" >> $GITHUB_OUTPUT
68+
fi
69+
else
70+
echo "Not a develop or feature branch, will use release"
71+
echo "source=release" >> $GITHUB_OUTPUT
72+
fi
73+
env:
74+
GH_TOKEN: ${{ inputs.github-token }}
75+
shell: bash
76+
77+
- name: Download artifact from workflow run
78+
if: steps.determine_source.outputs.source == 'artifact'
79+
run: |
80+
RUN_ID="${{ steps.determine_source.outputs.run_id }}"
81+
PLATFORM="${{ inputs.platform }}"
82+
83+
echo "Downloading artifacts from run $RUN_ID for platform $PLATFORM"
84+
85+
# 環境ファイルをダウンロード
86+
echo "Downloading $PLATFORM.env artifact..."
87+
gh run download $RUN_ID --name "$PLATFORM.env" || {
88+
echo "Failed to download $PLATFORM.env artifact"
89+
exit 1
90+
}
91+
92+
# 環境ファイルからパッケージ名を取得
93+
if [ -f momo.env ]; then
94+
source momo.env
95+
echo "Package name from env: $PACKAGE_NAME"
96+
else
97+
echo "momo.env not found"
98+
exit 1
99+
fi
100+
101+
# パッケージファイルをダウンロード
102+
echo "Downloading $PACKAGE_NAME artifact..."
103+
gh run download $RUN_ID --name "$PACKAGE_NAME" || {
104+
echo "Failed to download $PACKAGE_NAME artifact"
105+
exit 1
106+
}
107+
108+
echo "Successfully downloaded artifacts from feature branch build"
109+
env:
110+
GH_TOKEN: ${{ inputs.github-token }}
111+
shell: bash
112+
113+
- name: Download from release
114+
if: steps.determine_source.outputs.source == 'release'
115+
run: |
116+
VERSION="${{ steps.get_version.outputs.version }}"
117+
PLATFORM="${{ inputs.platform }}"
118+
119+
echo "Downloading from release $VERSION for platform $PLATFORM"
120+
121+
gh release download "$VERSION" \
122+
--pattern "momo-${VERSION}_${PLATFORM}.tar.gz" \
123+
--clobber || {
124+
echo "Failed to download release"
125+
exit 1
126+
}
127+
128+
echo "Successfully downloaded from release"
129+
env:
130+
GH_TOKEN: ${{ inputs.github-token }}
131+
shell: bash
132+
133+
- name: Extract momo binary
134+
run: |
135+
SOURCE="${{ steps.determine_source.outputs.source }}"
136+
VERSION="${{ steps.get_version.outputs.version }}"
137+
PLATFORM="${{ inputs.platform }}"
138+
139+
# tar.gz ファイルを探す
140+
if [ "$SOURCE" == "artifact" ]; then
141+
# artifact からダウンロードした場合
142+
PACKAGE_FILE=$(find . -name "momo-*.tar.gz" -type f | head -1)
143+
else
144+
# release からダウンロードした場合
145+
PACKAGE_FILE="momo-${VERSION}_${PLATFORM}.tar.gz"
146+
fi
147+
148+
if [ -z "$PACKAGE_FILE" ] || [ ! -f "$PACKAGE_FILE" ]; then
149+
echo "Package file not found: $PACKAGE_FILE"
150+
ls -la
151+
exit 1
152+
fi
153+
154+
echo "Extracting: $PACKAGE_FILE"
155+
tar -xzf "$PACKAGE_FILE"
156+
157+
# 展開されたディレクトリを探す
158+
EXTRACTED_DIR=$(find . -maxdepth 1 -type d -name "momo-*_*" | head -1)
159+
if [ -z "$EXTRACTED_DIR" ]; then
160+
echo "Extracted directory not found"
161+
ls -la
162+
exit 1
163+
fi
164+
165+
echo "Found extracted directory: $EXTRACTED_DIR"
166+
167+
# ビルドディレクトリ構造を再現
168+
mkdir -p _build/$PLATFORM/release
169+
mv "$EXTRACTED_DIR" _build/$PLATFORM/release/momo
170+
chmod +x _build/$PLATFORM/release/momo/momo
171+
172+
# バージョン確認
173+
echo "Verifying momo binary..."
174+
_build/$PLATFORM/release/momo/momo --version
175+
176+
echo "Binary setup complete (source: $SOURCE)"
177+
shell: bash

.github/actions/download/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
runs:
1111
using: composite
1212
steps:
13-
- uses: actions/download-artifact@v4
13+
- uses: actions/download-artifact@v5
1414
with:
1515
name: ${{ inputs.platform }}.env
1616
path: ${{ inputs.platform }}.env
@@ -22,7 +22,7 @@ runs:
2222
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
2323
echo "$PACKAGE_NAME/$PACKAGE_NAME" >> package_paths.env
2424
id: env
25-
- uses: actions/download-artifact@v4
25+
- uses: actions/download-artifact@v5
2626
with:
2727
name: ${{ steps.env.outputs.package_name }}
2828
path: ${{ steps.env.outputs.package_name }}

.github/workflows/build.yml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
- "THANKS"
1111
- "LICENSE"
1212
- "NOTICE"
13+
- "test/**"
14+
- ".github/workflows/e2e-test.yml"
15+
- ".github/workflows/claude.yml"
16+
schedule:
17+
# UTC の 01:00 は JST だと 10:00 。
18+
# 1-5 で 月曜日から金曜日
19+
- cron: "0 1 * * 1-5"
1320

1421
jobs:
1522
build-windows:
@@ -21,11 +28,11 @@ jobs:
2128
name: Build momo for ${{ matrix.name }}
2229
runs-on: windows-2022
2330
steps:
24-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
2532
- uses: microsoft/setup-msbuild@v2
2633
- name: Get Versions
2734
run: |
28-
Get-Content "VERSION" | Foreach-Object {
35+
Get-Content "DEPS" | Foreach-Object {
2936
if (!$_) { continue }
3037
$var = $_.Split('=')
3138
New-Variable -Name $var[0] -Value $var[1] -Force
@@ -43,7 +50,7 @@ jobs:
4350
key: windows-cuda-${{ steps.versions.outputs.cuda_version }}.v1
4451
- run: echo "${CUDA_VERSION}" > _install\windows_x86_64\release\cuda.version
4552
if: steps.cache-cuda.outputs.cache-hit == 'true'
46-
- run: python3 run.py --package ${{ matrix.name }}
53+
- run: python3 run.py build --package ${{ matrix.name }}
4754
- name: Get package name
4855
run: |
4956
Get-Content "_package\${{ matrix.name }}\release\momo.env" | Foreach-Object {
@@ -72,8 +79,8 @@ jobs:
7279
name: Build momo for ${{ matrix.name }}
7380
runs-on: macos-14
7481
steps:
75-
- uses: actions/checkout@v4
76-
- run: python3 run.py --package ${{ matrix.name }}
82+
- uses: actions/checkout@v5
83+
- run: python3 run.py build --package ${{ matrix.name }}
7784
- name: Get package name
7885
run: |
7986
source _package/${{ matrix.name }}/release/momo.env
@@ -101,7 +108,7 @@ jobs:
101108
name: Build momo for ${{ matrix.name }}
102109
runs-on: ${{ matrix.name == 'ubuntu-24.04_x86_64' && 'ubuntu-24.04' || 'ubuntu-22.04' }}
103110
steps:
104-
- uses: actions/checkout@v4
111+
- uses: actions/checkout@v5
105112
- name: Disk cleanup
106113
run: |
107114
set -x
@@ -148,8 +155,8 @@ jobs:
148155
EOF
149156
- name: Install deps for ${{ matrix.name }}
150157
run: |
151-
source VERSION
152-
# clang-18 と CUDA を入れる
158+
source DEPS
159+
# clang-20 と CUDA を入れる
153160
sudo apt-get update
154161
sudo apt-get install -y software-properties-common
155162
@@ -166,13 +173,13 @@ jobs:
166173
167174
wget https://apt.llvm.org/llvm.sh
168175
chmod a+x llvm.sh
169-
sudo ./llvm.sh 18
176+
sudo ./llvm.sh 20
170177
171178
# Intel Media SDK のために libva-dev, libdrm-dev を入れる
172179
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev
173180
# スクリーンキャプチャあたりのためのパッケージを入れる
174181
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libxrandr-dev libxdamage-dev libxcomposite-dev libxtst-dev
175-
- run: python3 run.py --package ${{ matrix.name }}
182+
- run: python3 run.py build --package ${{ matrix.name }}
176183
- name: Get package name
177184
run: |
178185
source _package/${{ matrix.name }}/release/momo.env
@@ -191,14 +198,14 @@ jobs:
191198

192199
create-release:
193200
name: Create Release
194-
if: contains(github.ref, 'tags/202')
201+
if: startsWith(github.ref, 'refs/tags/202')
195202
needs:
196203
- build-windows
197204
- build-macos
198205
- build-ubuntu
199-
runs-on: ubuntu-latest
206+
runs-on: ubuntu-22.04
200207
steps:
201-
- uses: actions/checkout@v4
208+
- uses: actions/checkout@v5
202209
- uses: ./.github/actions/download
203210
with:
204211
platform: windows_x86_64
@@ -219,26 +226,37 @@ jobs:
219226
platform: ubuntu-22.04_armv8_jetson
220227
- name: Env to output
221228
run: |
222-
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
223-
cat package_paths.env >> $GITHUB_OUTPUT
224-
echo "EOF" >> $GITHUB_OUTPUT
229+
# 改行をスペースに変換してpackage_pathsに設定
230+
echo "package_paths=$(cat package_paths.env | tr '\n' ' ')" >> $GITHUB_OUTPUT
225231
id: env
226-
- name: Release
227-
uses: softprops/action-gh-release@v2
228-
with:
229-
files: ${{ steps.env.outputs.package_paths }}
230-
prerelease: ${{ contains(github.ref, 'canary') }}
232+
- name: Release (Prerelease)
233+
if: contains(github.ref, 'canary')
234+
run: |
235+
gh release create "${{ github.ref_name }}" \
236+
${{ steps.env.outputs.package_paths }} \
237+
--title "${{ github.ref_name }}" \
238+
--prerelease
239+
env:
240+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241+
- name: Release (Stable)
242+
if: ${{ !contains(github.ref, 'canary') }}
243+
run: |
244+
gh release create "${{ github.ref_name }}" \
245+
${{ steps.env.outputs.package_paths }} \
246+
--title "${{ github.ref_name }}"
247+
env:
248+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
231249
notification:
232250
name: Slack Notification
233-
runs-on: ubuntu-latest
251+
runs-on: ubuntu-24.04
234252
needs:
235253
- build-windows
236254
- build-macos
237255
- build-ubuntu
238256
- create-release
239257
if: always()
240258
steps:
241-
- uses: actions/checkout@v4
259+
- uses: actions/checkout@v5
242260
- uses: rtCamp/action-slack-notify@v2
243261
if: |
244262
needs.build-windows.result == 'failure' ||

0 commit comments

Comments
 (0)