Skip to content

手動ビルドを追加 #1251

手動ビルドを追加

手動ビルドを追加 #1251

Workflow file for this run

name: build-workflow
on:
workflow_dispatch:
push:
paths-ignore:
- "doc/**"
- "html/**"
- "**.md"
- "THANKS"
- "LICENSE"
- "NOTICE"
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
name:
- windows_x86_64
name: Build momo for ${{ matrix.name }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Get Versions
run: |
Get-Content "VERSION" | Foreach-Object {
if (!$_) { continue }
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1] -Force
}
echo "cuda_version=${CUDA_VERSION}" >> ${Env:GITHUB_OUTPUT}
id: versions
# CUDA のインストールバイナリのダウンロードは 3GB ぐらいあって、
# ビルドの度に取得するのはつらいのでキャッシュする
# (インストールする nvcc は解凍後で 100MB 程度なのでキャッシュ可能)
- name: Cache CUDA ${{ steps.versions.outputs.cuda_version }}
id: cache-cuda
uses: actions/cache@v4
with:
path: _install\windows_x86_64\release\cuda
key: windows-cuda-${{ steps.versions.outputs.cuda_version }}.v1
- run: echo "${CUDA_VERSION}" > _install\windows_x86_64\release\cuda.version
if: steps.cache-cuda.outputs.cache-hit == 'true'
- run: python3 run.py --package ${{ matrix.name }}
- name: Get package name
run: |
Get-Content "_package\${{ matrix.name }}\release\momo.env" | Foreach-Object {
if (!$_) { continue }
$var = $_.Split('=')
New-Variable -Name $var[0] -Value $var[1] -Force
}
echo "name=${PACKAGE_NAME}" >> ${Env:GITHUB_OUTPUT}
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/momo.env
build-macos:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
name: Build momo for ${{ matrix.name }}
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- run: python3 run.py --package ${{ matrix.name }}
- name: Get package name
run: |
source _package/${{ matrix.name }}/release/momo.env
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/momo.env
build-ubuntu:
strategy:
fail-fast: false
matrix:
name:
- raspberry-pi-os_armv8
- ubuntu-22.04_x86_64
- ubuntu-24.04_x86_64
- ubuntu-22.04_armv8_jetson
name: Build momo for ${{ matrix.name }}
runs-on: ${{ matrix.name == 'ubuntu-24.04_x86_64' && 'ubuntu-24.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v4
- name: Disk cleanup
run: |
set -x
df -h
sudo du -h -d1 /usr/local
sudo du -h -d1 /usr/local/share
sudo du -h -d1 /usr/local/lib
sudo du -h -d1 /usr/share
RMI=`docker images -q -a`
if [ -n "$RMI" ]; then
docker rmi $RMI
fi
# 4.6G
sudo rm -rf /usr/local/.ghcup
# 1.7G
sudo rm -rf /usr/share/swift
# 1.4G
sudo rm -rf /usr/share/dotnet
df -h
- name: Install deps for Jetson and Raspberry Pi OS series
if: matrix.name == 'ubuntu-22.04_armv8_jetson' || matrix.name == 'raspberry-pi-os_armv8'
run: |
sudo apt-get update
sudo apt-get -y install multistrap binutils-aarch64-linux-gnu
# multistrap に insecure なリポジトリからの取得を許可する設定を入れる
sudo sed -e 's/Apt::Get::AllowUnauthenticated=true/Apt::Get::AllowUnauthenticated=true";\n$config_str .= " -o Acquire::AllowInsecureRepositories=true/' -i /usr/sbin/multistrap
# Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正
# ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab
- name: Fix CUDA issues for Ubuntu 24.04
if: matrix.name == 'ubuntu-24.04_x86_64'
run: |
sudo tee /etc/apt/sources.list.d/jammy.list << EOF
deb http://archive.ubuntu.com/ubuntu/ jammy universe
EOF
sudo tee /etc/apt/preferences.d/pin-jammy <<EOF
Package: *
Pin: release n=jammy
Pin-Priority: -10
Package: libtinfo5
Pin: release n=jammy
Pin-Priority: 990
EOF
- name: Install deps for ${{ matrix.name }}
run: |
source VERSION
# clang-18 と CUDA を入れる
sudo apt-get update
sudo apt-get install -y software-properties-common
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_*all.deb
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION
wget https://apt.llvm.org/llvm.sh
chmod a+x llvm.sh
sudo ./llvm.sh 18
# Intel Media SDK のために libva-dev, libdrm-dev を入れる
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev
# スクリーンキャプチャあたりのためのパッケージを入れる
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libxrandr-dev libxdamage-dev libxcomposite-dev libxtst-dev
- run: python3 run.py --package ${{ matrix.name }}
- name: Get package name
run: |
source _package/${{ matrix.name }}/release/momo.env
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/momo.env
create-release:
name: Create Release
if: contains(github.ref, 'tags/202')
needs:
- build-windows
- build-macos
- build-ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download
with:
platform: windows_x86_64
- uses: ./.github/actions/download
with:
platform: macos_arm64
- uses: ./.github/actions/download
with:
platform: raspberry-pi-os_armv8
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-24.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_armv8_jetson
- name: Env to output
run: |
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
cat package_paths.env >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
id: env
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.env.outputs.package_paths }}
prerelease: ${{ contains(github.ref, 'canary') }}
notification:
name: Slack Notification
runs-on: ubuntu-latest
needs:
- build-windows
- build-macos
- build-ubuntu
- create-release
if: always()
steps:
- uses: actions/checkout@v4
- uses: rtCamp/action-slack-notify@v2
if: |
needs.build-windows.result == 'failure' ||
needs.build-macos.result == 'failure' ||
needs.build-ubuntu.result == 'failure' ||
needs.create-release.result == 'failure'
env:
SLACK_CHANNEL: open-momo
SLACK_COLOR: danger
SLACK_TITLE: Failure build
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}