Skip to content

Commit 1106c08

Browse files
authored
Add github action to validate server-sdk-go version on release (#718)
* add github action to validate server-sdk-go version on release * remove non-text characters
1 parent 9002fc1 commit 1106c08

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

.github/workflows/release.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ jobs:
3333
uses: actions/checkout@v5
3434
with:
3535
lfs: 'true'
36+
37+
- name: Verify server-sdk-go version
38+
run: |
39+
livekit_cli_ver=${GITHUB_REF#refs/tags/}
40+
server_sdk_go_ver=$(git ls-remote --tags --sort='v:refname' https://github.com/livekit/server-sdk-go.git \
41+
| awk -F'refs/tags/' '{print $2}' \
42+
| grep -E '^v[0-9]+\.[0-9]+' \
43+
| tail -n1)
44+
livekit_cli_major_minor=$(echo "$livekit_cli_ver" | sed -E 's/^v([0-9]+\.[0-9]+)\..*/\1/')
45+
server_sdk_go_major_minor=$(echo "$server_sdk_go_ver" | sed -E 's/^v([0-9]+\.[0-9]+)\..*/\1/')
46+
echo "livekit-cli: $livekit_cli_ver ($livekit_cli_major_minor)"
47+
echo "server-sdk-go: $server_sdk_go_ver ($server_sdk_go_major_minor)"
48+
if [ "$livekit_cli_major_minor" != "$server_sdk_go_major_minor" ]; then
49+
echo "version mismatch: livekit-cli ($livekit_cli_major_minor) ≠ server-sdk-go ($server_sdk_go_major_minor)"
50+
exit 1
51+
fi
52+
echo "versions match ($livekit_cli_major_minor)"
3653
3754
- run: git lfs pull
3855

cmd/lk/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error {
581581

582582
regions := []string{region}
583583
excludeFiles := []string{fmt.Sprintf("**/%s", config.LiveKitTOMLFile)}
584-
resp, err := agentsClient.CreateAgent(ctx, os.DirFS(workingDir), secrets, regions, excludeFiles)
584+
resp, err := agentsClient.CreateAgent(ctx, os.DirFS(workingDir), secrets, regions, excludeFiles, os.Stderr)
585585
if err != nil {
586586
if twerr, ok := err.(twirp.Error); ok {
587587
return fmt.Errorf("unable to create agent: %s", twerr.Msg())
@@ -726,7 +726,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error {
726726
}
727727

728728
excludeFiles := []string{fmt.Sprintf("**/%s", config.LiveKitTOMLFile)}
729-
if err := agentsClient.DeployAgent(ctx, agentId, os.DirFS(workingDir), secrets, excludeFiles); err != nil {
729+
if err := agentsClient.DeployAgent(ctx, agentId, os.DirFS(workingDir), secrets, excludeFiles, os.Stderr); err != nil {
730730
if twerr, ok := err.(twirp.Error); ok {
731731
return fmt.Errorf("unable to deploy agent: %s", twerr.Msg())
732732
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/go-task/task/v3 v3.44.1
1414
github.com/joho/godotenv v1.5.1
1515
github.com/livekit/protocol v1.42.3-0.20251024111301-1e3becbff5d1
16-
github.com/livekit/server-sdk-go/v2 v2.12.1
16+
github.com/livekit/server-sdk-go/v2 v2.12.4
1717
github.com/moby/patternmatcher v0.6.0
1818
github.com/pelletier/go-toml v1.9.5
1919
github.com/pion/rtcp v1.2.15

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ github.com/livekit/psrpc v0.7.0 h1:rtfqfjYN06WJYloE/S0nmkJ/Y04x4pxLQLe8kQ4FVHU=
273273
github.com/livekit/psrpc v0.7.0/go.mod h1:AuDC5uOoEjQJEc69v4Li3t77Ocz0e0NdjQEuFfO+vfk=
274274
github.com/livekit/server-sdk-go/v2 v2.12.1 h1:6F4OWwWPcUjyhaWPNL5BE1XEJt9KzX4/10P5ADeL7xY=
275275
github.com/livekit/server-sdk-go/v2 v2.12.1/go.mod h1:6EZr5pBYOJ4cT1i5YnZ/L+GOeOqx6e6fKtVgU8itXuc=
276+
github.com/livekit/server-sdk-go/v2 v2.12.4 h1:pcNCgGfO7iYb3dQij7vp2Kee8kHNRSj/lJWpA/VNtN0=
277+
github.com/livekit/server-sdk-go/v2 v2.12.4/go.mod h1:EGWi7fcsHawWOCxUIlnSHC3fzWBsCEscLkouIZEzGKY=
276278
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
277279
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
278280
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=

0 commit comments

Comments
 (0)