-
Notifications
You must be signed in to change notification settings - Fork 89
237 lines (237 loc) · 8.15 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
name: build
on:
push:
paths-ignore:
- "**.md"
- "LICENSE"
- "NOTICE"
- ".gitignore"
- "scripts/version_update.sh"
branches-ignore:
- daily
tags:
- "*"
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
platform:
- name: windows_x86_64
- name: windows_arm64
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: python3 --version
- name: Disk Cleanup
run: |
Get-PSDrive
# Cache 済み Docker Image の削除
docker rmi $(docker images -q -a)
# Android SDK の削除
if ($Env:ANDROID_HOME) {
Remove-Item -Recurse -Force $Env:ANDROID_HOME -ErrorAction Ignore
}
if ($Env:ANDROID_NDK_HOME) {
Remove-Item -Recurse -Force $Env:ANDROID_NDK_HOME -ErrorAction Ignore
}
# JVM の削除
if ($Env:JAVA_HOME_11_X64) {
Remove-Item -Recurse -Force $Env:JAVA_HOME_11_X64 -ErrorAction Ignore
}
if ($Env:JAVA_HOME_8_X64) {
Remove-Item -Recurse -Force $Env:JAVA_HOME_8_X64 -ErrorAction Ignore
}
Get-PSDrive
- name: Setup Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Build ${{ matrix.platform.name }}
run: |
# リポジトリの下に置きたいが、GitHub Actions の D:\ の容量が少なくてビルド出来ない問題があるので
# このパスにソースを配置する。
# また、WebRTC のビルドしたファイルは同じドライブに無いといけないっぽいのでこちらも設定する。
python3 run.py build ${{ matrix.platform.name }} --source-dir 'C:\webrtc' --build-dir 'C:\webrtc-build'
python3 run.py package ${{ matrix.platform.name }} --source-dir 'C:\webrtc' --build-dir 'C:\webrtc-build'
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webrtc.${{ matrix.platform.name }}.zip
path: _package/${{ matrix.platform.name }}/webrtc.${{ matrix.platform.name }}.zip
build-macos:
strategy:
fail-fast: false
matrix:
platform:
- name: macos_arm64
- name: ios
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Select Xcode 15.4
run: sudo xcode-select --switch /Applications/Xcode_15.4.app/Contents/Developer
- run: brew install ninja
- name: Setup Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Build ${{ matrix.platform.name }} for macos
if: matrix.platform.name == 'macos_arm64'
run: |
python3 run.py build ${{ matrix.platform.name }}
python3 run.py package ${{ matrix.platform.name }}
- name: Build ${{ matrix.platform.name }} for ios
if: matrix.platform.name == 'ios'
run: |
python3 run.py build ${{ matrix.platform.name }} --webrtc-overlap-ios-build-dir
python3 run.py package ${{ matrix.platform.name }} --webrtc-overlap-ios-build-dir
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webrtc.${{ matrix.platform.name }}.tar.gz
path: _package/${{ matrix.platform.name }}/webrtc.${{ matrix.platform.name }}.tar.gz
build-linux:
strategy:
fail-fast: false
matrix:
platform:
- name: raspberry-pi-os_armv6
runs-on: ubuntu-20.04
- name: raspberry-pi-os_armv7
runs-on: ubuntu-20.04
- name: raspberry-pi-os_armv8
runs-on: ubuntu-20.04
- name: ubuntu-20.04_armv8
runs-on: ubuntu-20.04
- name: ubuntu-22.04_armv8
runs-on: ubuntu-22.04
- name: ubuntu-24.04_armv8
runs-on: ubuntu-24.04
- name: ubuntu-20.04_x86_64
runs-on: ubuntu-20.04
- name: ubuntu-22.04_x86_64
runs-on: ubuntu-22.04
- name: ubuntu-24.04_x86_64
runs-on: ubuntu-24.04
- name: android
runs-on: ubuntu-22.04
runs-on: ${{ matrix.platform.runs-on }}
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
# 13G
sudo rm -rf /usr/local/lib/android
df -h
- name: Get stats
run: |
set -x
cat /etc/lsb-release
uname -a
cat /proc/cpuinfo
cat /proc/meminfo
- name: Setup ${{ matrix.platform.name }} for x86_64
if: endsWith(matrix.platform.name, '_x86_64')
run: sudo scripts/apt_install_x86_64.sh
- name: Setup ${{ matrix.platform.name }} for arm
if: contains(matrix.platform.name, '_armv')
run: sudo scripts/apt_install_arm.sh
- name: Setup ${{ matrix.platform.name }} for android
if: matrix.platform.name == 'android'
run: sudo scripts/apt_install_x86_64.sh && sudo apt-get install -y openjdk-11-jdk
- name: Setup Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Build ${{ matrix.platform.name }}
run: |
python3 run.py build ${{ matrix.platform.name }}
python3 run.py package ${{ matrix.platform.name }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: webrtc.${{ matrix.platform.name }}.tar.gz
path: _package/${{ matrix.platform.name }}/webrtc.${{ matrix.platform.name }}.tar.gz
create-release:
name: Create Release
if: contains(github.ref, 'tags/m')
needs:
- build-windows
- build-macos
- build-linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download
with:
platform: windows_x86_64
- uses: ./.github/actions/download
with:
platform: windows_arm64
- uses: ./.github/actions/download
with:
platform: macos_arm64
- uses: ./.github/actions/download
with:
platform: ios
- 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_armv8
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_armv8
- uses: ./.github/actions/download
with:
platform: ubuntu-24.04_armv8
- uses: ./.github/actions/download
with:
platform: ubuntu-20.04_x86_64
- 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: android
- 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 }}