Skip to content

Commit 2544008

Browse files
Update protocol and generate stubs on CI (#152)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 569c24d commit 2544008

File tree

12 files changed

+161
-113
lines changed

12 files changed

+161
-113
lines changed

.github/workflows/build-protocol.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,41 @@ env:
1919
PACKAGE_DIR: ./livekit-protocol
2020

2121
jobs:
22+
generate_protobuf:
23+
runs-on: ubuntu-latest
24+
name: Generating protobuf
25+
if: github.event_name == 'pull_request'
26+
27+
defaults:
28+
run:
29+
working-directory: ${{ env.PACKAGE_DIR }}
30+
steps:
31+
- uses: actions/checkout@v3
32+
with:
33+
submodules: true
34+
ref: ${{ github.event.pull_request.head.ref }}
35+
36+
- uses: actions/setup-python@v4
37+
38+
- name: Install Protoc
39+
uses: arduino/setup-protoc@v2
40+
with:
41+
version: "25.2"
42+
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: install mypy-protobuf
45+
run: pip3 install mypy-protobuf
46+
47+
- name: generate python stubs
48+
run: ./generate_proto.sh
49+
50+
- name: Add changes
51+
uses: EndBug/add-and-commit@v9
52+
with:
53+
add: '["livekit-protocol/"]'
54+
default_author: github_actions
55+
message: generated protobuf
56+
2257
build_wheels:
2358
name: Build Protocol wheel/sdist
2459
runs-on: ubuntu-latest

livekit-protocol/generate_proto.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
# This script requires protobuf-compiler and https://github.com/nipunn1313/mypy-protobuf
1818

19+
set -e
20+
1921
API_PROTOCOL=./protocol
2022
API_OUT_PYTHON=./livekit/protocol
2123

livekit-protocol/livekit/protocol/agent.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-protocol/livekit/protocol/analytics.py

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)