-
Notifications
You must be signed in to change notification settings - Fork 60
181 lines (153 loc) · 5.73 KB
/
webrtc-builds.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
# Copyright 2023 LiveKit, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: WebRTC builds
on:
push:
tags:
- "webrtc-*"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- name: win
os: windows-2019
cmd: .\build_windows.cmd
arch: x64
- name: win
os: windows-2019
cmd: .\build_windows.cmd
arch: arm64
- name: mac
os: macos-13
cmd: ./build_macos.sh
arch: x64
- name: mac
os: macos-13
cmd: ./build_macos.sh
arch: arm64
- name: linux
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_linux.sh
arch: x64
- name: linux
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_linux.sh
arch: arm64
- name: android
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_android.sh
arch: arm64
- name: android
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_android.sh
arch: arm
- name: android
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_android.sh
arch: x64
- name: ios
out: ios-device-arm64
os: macos-13
cmd: ./build_ios.sh
arch: arm64
- name: ios
out: ios-simulator-arm64
os: macos-13
cmd: ./build_ios.sh
arch: arm64
buildargs: --environment simulator
profile:
- release
# - debug
name: Build webrtc (${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.profile }}) ${{ matrix.target.buildargs }}
runs-on: ${{ matrix.target.os }}
steps:
- name: Setup variables
id: setup
run: |
DEFAULT_OUT=${{ matrix.target.name }}-${{ matrix.target.arch }}
OUT=${{ matrix.target.out == '' && '$DEFAULT_OUT' || matrix.target.out }}-${{ matrix.profile }}
echo OUT=$OUT >> $GITHUB_OUTPUT
echo ZIP=webrtc-$OUT.zip >> $GITHUB_OUTPUT
shell: bash
# Print some debug infos to be sure everything is ok before doing really long tasks..
- name: Info
run: |
echo "OutName: ${{ steps.setup.outputs.OUT }}"
echo "OutZip: ${{ steps.setup.outputs.ZIP }}"
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
- run: pip3 install setuptools # pkg_resources is sometimes not found?
- name: Install linux dependencies
if: ${{ matrix.target.os == 'ubuntu-20.04' || matrix.target.os == 'ubuntu-latest' || matrix.target.os == 'buildjet-8vcpu-ubuntu-2004' }}
run: |
sudo apt update -y
sudo apt install -y ninja-build pkg-config openjdk-11-jdk
- name: Install macos dependencies
if: ${{ matrix.target.os == 'macos-13' }}
run: brew install ninja
- name: Install windows dependencies
if: ${{ matrix.target.os == 'windows-2019' }}
run: |
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip" -OutFile ninja.zip
Expand-Archive -Path ninja.zip -DestinationPath ${{ github.workspace }}\ninja
echo "${{ github.workspace }}\ninja" | Out-File -Append -Encoding utf8 -FilePath $Env:GITHUB_PATH
- name: Print ninja version
run: ninja --version
- name: Target OS
run: echo -e "\ntarget_os = [\"${{ matrix.target.name }}\"]" >> .gclient
shell: bash
working-directory: webrtc-sys/libwebrtc
- name: Build WebRTC
run: ${{ matrix.target.cmd }} --arch ${{ matrix.target.arch }} --profile ${{ matrix.profile }} ${{ matrix.target.buildargs }}
working-directory: webrtc-sys/libwebrtc
- name: Zip artifact (Unix)
if: ${{ matrix.target.os != 'windows-2019' }}
run: |
cd webrtc-sys/libwebrtc
zip ${{ github.workspace }}/${{ steps.setup.outputs.ZIP }} ${{ steps.setup.outputs.OUT }} -r
- name: Zip artifact (Windows)
if: ${{ matrix.target.os == 'windows-2019' }}
run: Compress-Archive -Path .\webrtc-sys\libwebrtc\${{ steps.setup.outputs.OUT }} -DestinationPath ${{ steps.setup.outputs.ZIP }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: webrtc-builds-${{ matrix.name }}-${{ matrix.arch }}
path: ${{ steps.setup.outputs.ZIP }}
release:
name: Release to GH (Draft)
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/webrtc-')
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: webrtc-builds-*
merge-multiple: true
path: ${{ github.workspace }}/webrtc-builds
- name: Create draft release
run: |
gh release create ${{ github.ref_name }} --draft --title "${{ github.ref_name }}"
gh release upload ${{ github.ref_name }} ${{ github.workspace }}/webrtc-builds/*