-
Notifications
You must be signed in to change notification settings - Fork 114
197 lines (176 loc) · 5.67 KB
/
build-rtc.yml
File metadata and controls
197 lines (176 loc) · 5.67 KB
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
name: Build RTC
on:
push:
branches:
- main
paths:
- livekit-rtc/**
tags:
- "rtc-v*.*.*"
pull_request:
branches:
- main
paths:
- livekit-rtc/**
workflow_dispatch:
env:
PACKAGE_DIR: ./livekit-rtc
jobs:
generate_protobuf:
runs-on: ubuntu-latest
name: Generating protobuf
if: github.event_name == 'pull_request'
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
with:
version: "25.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install deps
run: |
pip3 install mypy-protobuf==3.6.0 "protobuf>=4.25.0,<5.0.0"
- name: generate python stubs
run: ./generate_proto.sh
- name: Add changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
with:
add: '["livekit-rtc/"]'
default_author: github_actions
message: generated protobuf
build_wheels:
name: Build RTC wheels (${{ matrix.archs }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# wheels to build:
include:
- os: ubuntu-latest
archs: x86_64
- os: namespace-profile-default-arm64
archs: aarch64
- os: windows-latest
archs: AMD64
- os: macos-latest
archs: x86_64 arm64
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
id: setup-python
with:
python-version: "3.11"
- name: Build wheels
run: pipx run --python '${{ steps.setup-python.outputs.python-path }}' cibuildwheel==3.3.1 --output-dir dist
env:
CIBW_ARCHS: ${{ matrix.archs }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: rtc-release-${{ matrix.os }}
path: livekit-rtc/dist/*.whl
make_sdist:
name: Make RTC sdist
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build sdist
run: |
pip3 install build
python3 -m build --sdist
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: rtc-release-sdist
path: livekit-rtc/dist/*.tar.gz
test:
name: Test (${{ matrix.os }}, Python ${{ matrix.python-version }})
needs: [build_wheels]
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64 tests
- os: ubuntu-latest
python-version: "3.9"
artifact: rtc-release-ubuntu-latest
- os: ubuntu-latest
python-version: "3.10"
artifact: rtc-release-ubuntu-latest
- os: ubuntu-latest
python-version: "3.11"
artifact: rtc-release-ubuntu-latest
- os: ubuntu-latest
python-version: "3.12"
artifact: rtc-release-ubuntu-latest
- os: ubuntu-latest
python-version: "3.13"
artifact: rtc-release-ubuntu-latest
- os: ubuntu-latest
python-version: "3.14"
artifact: rtc-release-ubuntu-latest
# macOS tests (arm64 runner)
- os: macos-latest
python-version: "3.9"
artifact: rtc-release-macos-latest
- os: macos-latest
python-version: "3.12"
artifact: rtc-release-macos-latest
- os: macos-latest
python-version: "3.14"
artifact: rtc-release-macos-latest
# Windows tests
- os: windows-latest
python-version: "3.9"
artifact: rtc-release-windows-latest
- os: windows-latest
python-version: "3.12"
artifact: rtc-release-windows-latest
- os: windows-latest
python-version: "3.14"
artifact: rtc-release-windows-latest
uses: ./.github/workflows/tests.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
artifact-name: ${{ matrix.artifact }}
secrets:
LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
publish:
name: Publish RTC release
needs: [build_wheels, make_sdist, test]
runs-on: ubuntu-latest
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/rtc-v') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: rtc-release-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
docs:
needs: [publish]
uses: ./.github/workflows/build-docs.yml
with:
package_dir: "livekit-rtc"
package_name: "livekit.rtc"
secrets: inherit