-
Notifications
You must be signed in to change notification settings - Fork 89
192 lines (192 loc) · 6.31 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
name: build
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'NOTICE'
- '.gitignore'
branches-ignore:
- daily
tags:
- '*'
jobs:
build-windows:
strategy:
fail-fast: false
matrix:
name:
- windows_x86_64
- windows_arm64
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- 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: Build ${{ matrix.name }}
run: |
# リポジトリの下に置きたいが、GitHub Actions の D:\ の容量が少なくてビルド出来ない問題があるので
# このパスにソースを配置する。
# また、WebRTC のビルドしたファイルは同じドライブに無いといけないっぽいのでこちらも設定する。
python3 run.py build ${{ matrix.name }} --source-dir 'C:\webrtc' --build-dir 'C:\webrtc-build'
python3 run.py package ${{ matrix.name }} --source-dir 'C:\webrtc' --build-dir 'C:\webrtc-build'
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: webrtc.${{ matrix.name }}.zip
path: _package/${{ matrix.name }}/webrtc.${{ matrix.name }}.zip
build-macos:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- ios
runs-on: macOS-11.0
steps:
- uses: actions/checkout@v4
- name: Select Xcode 13.0
run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
- run: brew install ninja
- name: Build ${{ matrix.name }} for macos
if: matrix.name == 'macos_arm64'
run: |
python3 run.py build ${{ matrix.name }}
python3 run.py package ${{ matrix.name }}
- name: Build ${{ matrix.name }} for ios
if: matrix.name == 'ios'
run: |
python3 run.py build ${{ matrix.name }} --webrtc-overlap-ios-build-dir
python3 run.py package ${{ matrix.name }} --webrtc-overlap-ios-build-dir
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: _package/${{ matrix.name }}/webrtc.${{ matrix.name }}.tar.gz
build-linux:
strategy:
fail-fast: false
matrix:
name:
- raspberry-pi-os_armv6
- raspberry-pi-os_armv7
- raspberry-pi-os_armv8
- ubuntu-18.04_armv8
- ubuntu-20.04_armv8
- ubuntu-20.04_x86_64
- ubuntu-22.04_x86_64
- android
runs-on: ${{ matrix.name == 'ubuntu-22.04_x86_64' && 'ubuntu-22.04' || 'ubuntu-20.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
docker rmi `docker images -q -a`
# 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: Setup ${{ matrix.name }} for x86_64
if: endsWith(matrix.name, '_x86_64')
run: sudo scripts/apt_install_x86_64.sh
- name: Setup ${{ matrix.name }} for arm
if: contains(matrix.name, '_armv')
run: sudo scripts/apt_install_arm.sh
- name: Setup ${{ matrix.name }} for android
if: matrix.name == 'android'
run: sudo scripts/apt_install_x86_64.sh && sudo apt-get install -y openjdk-11-jdk
- name: Build ${{ matrix.name }}
run: |
python3 run.py build ${{ matrix.name }}
python3 run.py package ${{ matrix.name }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: _package/${{ matrix.name }}/webrtc.${{ matrix.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-18.04_armv8
- uses: ./.github/actions/download
with:
platform: ubuntu-20.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: 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 }}