-
Notifications
You must be signed in to change notification settings - Fork 55
103 lines (88 loc) · 2.28 KB
/
build-protocol.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
name: Build Protocol
on:
push:
branches:
- main
paths:
- livekit-protocol/**
tags:
- "protocol-v*.*.*"
pull_request:
branches:
- main
paths:
- livekit-protocol/**
workflow_dispatch:
env:
PACKAGE_DIR: ./livekit-protocol
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@v4
with:
submodules: true
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@v4
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "25.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: generate python stubs
run: ./generate_proto.sh
- name: Add changes
uses: EndBug/add-and-commit@v9
with:
add: '["livekit-protocol/"]'
default_author: github_actions
message: generated protobuf
build_wheels:
name: Build Protocol wheel/sdist
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.PACKAGE_DIR }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
- name: Build wheel & sdist
run: |
pip3 install build wheel
python3 -m build --wheel --sdist
- uses: actions/upload-artifact@v4
with:
name: protocol-release
path: |
livekit-protocol/dist/*.whl
livekit-protocol/dist/*.tar.gz
publish:
name: Publish Protocol release
needs: build_wheels
runs-on: ubuntu-latest
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/protocol-v')
steps:
- uses: actions/download-artifact@v4
with:
name: protocol-release
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
docs:
needs: [publish]
uses: ./.github/workflows/build-docs.yml
with:
package_dir: "livekit-protocol"
package_name: "livekit.protocol"
secrets: inherit