-
Notifications
You must be signed in to change notification settings - Fork 172
240 lines (238 loc) · 8.43 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
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 }}