Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate protobufs and set up changesets publishing workflow #629

Merged
merged 19 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@livekit/changesets-changelog-github",
{ "repo": "livekit/protocol" }
],
"commit": false,
"fixed": [["github.com/livekit/protocol", "@livekit/protocol"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": { "version": true, "tag": true }
}
66 changes: 34 additions & 32 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,43 @@ name: Test
on:
workflow_dispatch:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/go/bin
~/.cache
key: livekit-protocol

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/[email protected]

- name: Download Go modules
run: go mod download

- name: Static Check
uses: amarpal/staticcheck-action@master
with:
checks: '["all", "-ST1000", "-ST1003", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
install-go: false

- name: Test
run: |
set -euo pipefail
MallocNanoZone=0 go test -race -json -v ./... 2>&1 | gotestfmt
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/go/bin
~/.cache
key: livekit-protocol

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache-dependency-path: |
packages/golang/go.sum
lukasIO marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/[email protected]

- name: Download Go modules
run: go mod download

- name: Static Check
uses: amarpal/staticcheck-action@master
with:
checks: '["all", "-ST1000", "-ST1003", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
install-go: false

- name: Test
run: |
set -euo pipefail
MallocNanoZone=0 go test -race -json -v ./... 2>&1 | gotestfmt
85 changes: 51 additions & 34 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,59 @@ name: Generate
on:
workflow_dispatch:
push:
branches-ignore: [ main ]
branches-ignore: [main]

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4

- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.20'

- name: Go mod tidy
run: go mod tidy

- name: Install generators
uses: magefile/mage-action@v3
with:
version: latest
args: bootstrap

- name: Generate Protobuf
uses: magefile/mage-action@v3
with:
version: latest
args: proto

- name: Add changes
uses: EndBug/add-and-commit@v9
with:
add: '["livekit", "rpc", "infra"]'
default_author: github_actions
message: generated protobuf
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4

- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ">=1.20"

- name: Go mod tidy
run: go mod tidy

- name: Install generators
uses: magefile/mage-action@v3
with:
version: latest
install-only: true

- name: Bootstrap
run: mage bootstrap

- name: Generate Protobuf
run: mage proto

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install JS dependencies
run: pnpm install

- name: Test generate JS files
run: |
pnpm --filter @livekit/protocol run generate:proto

- name: Add changes
uses: EndBug/add-and-commit@v9
with:
add: '["livekit", "rpc", "infra"]'
default_author: github_actions
message: generated protobuf
60 changes: 0 additions & 60 deletions .github/workflows/release-js.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish packages
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called ci:publish which does a build for your packages and calls changeset publish
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
# Dependency directories (remove the comment below to include it)
# vendor/
.idea/

node_modules/
2 changes: 1 addition & 1 deletion infra/link.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_analytics.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_egress.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_ingress.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_internal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_models.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_room.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_rtc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_sip.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion livekit/livekit_webhook.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading