docker が使用しているディスク容量を確認するように修正 #1136
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-workflow | |
on: | |
push: | |
paths-ignore: | |
- 'doc/**' | |
- 'html/**' | |
- '**.md' | |
- 'THANKS' | |
- 'LICENSE' | |
- 'NOTICE' | |
jobs: | |
build-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- x86_64 | |
name: Build momo for Windows_${{ matrix.arch }} | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: microsoft/setup-msbuild@v1.3 | |
# - uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11 | |
# with: | |
# sdk-version: 20348 | |
- name: test | |
run: | | |
ls "C:\Program Files (x86)\Windows Kits\10\Include\" | |
- name: Get Versions | |
run: | | |
Get-Content "VERSION" | Foreach-Object { | |
if (!$_) { continue } | |
$var = $_.Split('=') | |
New-Variable -Name $var[0] -Value $var[1] -Force | |
} | |
echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT | |
echo "wincuda_version=${WINCUDA_VERSION}" >> $GITHUB_OUTPUT | |
id: versions | |
# Boost はよくダウンロード先に繋がらずエラーになるのでキャッシュする | |
- name: Cache Boost ${{ steps.versions.outputs.boost_version }} | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: _cache\boost | |
key: windows-boost-${{ steps.versions.outputs.boost_version }}.zip.v6 | |
# CUDA のインストールバイナリのダウンロードは 3GB ぐらいあって、 | |
# ビルドの度に取得するのはつらいのでキャッシュする | |
# (インストールする nvcc は解凍後で 100MB 程度なのでキャッシュ可能) | |
- name: Cache NVCC ${{ steps.versions.outputs.wincuda_version }} | |
id: cache-cuda | |
uses: actions/cache@v3 | |
with: | |
path: build\windows_x86_64\_install\cuda\nvcc | |
key: windows-cuda-${{ steps.versions.outputs.wincuda_version }}.v2 | |
- run: "& .\\build.ps1 -package" | |
working-directory: build | |
timeout-minutes: 120 | |
- name: Output package name | |
run: | | |
Get-Content "VERSION" | Foreach-Object { | |
if (!$_) { continue } | |
$var = $_.Split('=') | |
New-Variable -Name $var[0] -Value $var[1] -Force | |
} | |
$WINVER_MAJOR = [System.Environment]::OSVersion.Version.Major | |
$RELEASE_ID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseID | |
echo "PACKAGE_NAME=momo-${MOMO_VERSION}_windows-${WINVER_MAJOR}.${RELEASE_ID}_${{ matrix.arch }}.zip" >> windows_${{ matrix.arch }}.env | |
echo "CONTENT_TYPE=application/zip" >> windows_${{ matrix.arch }}.env | |
echo "name=momo-${MOMO_VERSION}_windows-${WINVER_MAJOR}.${RELEASE_ID}_${{ matrix.arch }}.zip" >> ${Env:GITHUB_OUTPUT} | |
id: package_name | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.package_name.outputs.name }} | |
path: _package/${{ steps.package_name.outputs.name }} | |
- name: Upload Environment | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows_${{ matrix.arch }}.env | |
path: windows_${{ matrix.arch }}.env | |
build-macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- arm64 | |
name: Build momo for macOS_${{ matrix.arch }} | |
runs-on: macos-11.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Versions | |
run: | | |
source VERSION | |
echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT | |
id: versions | |
- name: Cache Boost ${{ steps.versions.outputs.boost_version }} | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: _cache/boost | |
key: macos-boost-${{ steps.versions.outputs.boost_version }}.tar.gz.v3 | |
- run: ./build.sh --package macos_${{ matrix.arch }} | |
working-directory: build | |
timeout-minutes: 120 | |
- name: Output package name | |
shell: bash | |
run: | | |
source VERSION | |
MACOS_VERSION=`sw_vers -productVersion | cut -d '.' -f-2` | |
echo "PACKAGE_NAME=momo-${MOMO_VERSION}_macos-${MACOS_VERSION}_${{ matrix.arch }}.tar.gz" >> macos_${{ matrix.arch }}.env | |
echo "CONTENT_TYPE=application/gzip" >> macos_${{ matrix.arch }}.env | |
echo "name=momo-${MOMO_VERSION}_macos-${MACOS_VERSION}_${{ matrix.arch }}.tar.gz" >> $GITHUB_OUTPUT | |
id: package_name | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.package_name.outputs.name }} | |
path: _package/${{ steps.package_name.outputs.name }} | |
- name: Upload Environment | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos_${{ matrix.arch }}.env | |
path: macos_${{ matrix.arch }}.env | |
build-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
name: | |
- raspberry-pi-os_armv6 | |
- raspberry-pi-os_armv7 | |
- raspberry-pi-os_armv8 | |
- ubuntu-20.04_x86_64 | |
- ubuntu-20.04_armv8_jetson_xavier | |
- ubuntu-22.04_x86_64 | |
name: Build momo for ${{ matrix.name }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Versions | |
run: | | |
source VERSION | |
echo "boost_version=${BOOST_VERSION}" >> $GITHUB_OUTPUT | |
id: versions | |
- name: Cache Boost ${{ steps.versions.outputs.boost_version }} | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: _cache/boost | |
key: ${{ matrix.name }}-boost-${{ steps.versions.outputs.boost_version }}.tar.gz.v3 | |
- run: ./build.sh --no-tty --no-mount --package ${{ matrix.name }} | |
working-directory: build | |
timeout-minutes: 120 | |
- name: Output package name | |
shell: bash | |
run: | | |
source VERSION | |
echo "PACKAGE_NAME=momo-${MOMO_VERSION}_${{ matrix.name }}.tar.gz" >> ${{ matrix.name }}.env | |
echo "CONTENT_TYPE=application/gzip" >> ${{ matrix.name }}.env | |
echo "name=momo-${MOMO_VERSION}_${{ matrix.name }}.tar.gz" >> $GITHUB_OUTPUT | |
id: package_name | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.package_name.outputs.name }} | |
path: _package/${{ steps.package_name.outputs.name }} | |
- name: Upload Environment | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.name }}.env | |
path: ${{ matrix.name }}.env | |
create-release: | |
name: Create Release | |
if: contains(github.ref, 'tags/202') | |
needs: | |
- build-windows | |
- build-macos | |
- build-linux | |
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_armv6 | |
- uses: ./.github/actions/download | |
with: | |
platform: raspberry-pi-os_armv7 | |
- uses: ./.github/actions/download | |
with: | |
platform: raspberry-pi-os_armv8 | |
- uses: ./.github/actions/download | |
with: | |
platform: ubuntu-20.04_x86_64 | |
- uses: ./.github/actions/download | |
with: | |
platform: ubuntu-20.04_armv8_jetson_xavier | |
- uses: ./.github/actions/download | |
with: | |
platform: ubuntu-22.04_x86_64 | |
- 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@v1 | |
with: | |
files: | |
${{ steps.env.outputs.package_paths }} | |
notification: | |
name: Slack Notification | |
runs-on: ubuntu-latest | |
needs: | |
- build-windows | |
- build-macos | |
- build-linux | |
- 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-linux.result == 'failure' || | |
needs.create-release.result == 'failure' || | |
needs.upload-assets.result == 'failure' | |
env: | |
SLACK_CHANNEL: open-momo | |
SLACK_COLOR: danger | |
SLACK_TITLE: Failure build | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |