-
Notifications
You must be signed in to change notification settings - Fork 113
132 lines (117 loc) · 3.65 KB
/
Copy pathci.yml
File metadata and controls
132 lines (117 loc) · 3.65 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
name: CI
env:
APP_NAME: rtc-node
MACOSX_DEPLOYMENT_TARGET: '10.13'
CARGO_TERM_COLOR: always
permissions:
id-token: write # Required for OIDC
contents: write # Required to create GH releases
pull-requests: write # Required to interact with PRs
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
paths:
- 'packages/**'
- 'examples/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'REUSE.toml'
- '.github/workflows'
branches:
- main
jobs:
lint:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 24 # NPM v11.5.1 or later is required for OIDC, which ships with node v24
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint
- name: Prettier
run: pnpm format:check
reuse:
name: REUSE-3.2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fsfe/reuse-action@v5
test:
name: Test
strategy:
matrix:
node-version: [20, 22, 24, latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Test build
run: pnpm --filter="*livekit*" run build
- name: Test livekit-server-sdk (Node)
run: pnpm --filter="livekit-server-sdk" test
- name: Test livekit-server-sdk (Browser)
run: pnpm --filter="livekit-server-sdk" test:browser
- name: Test env livekit-server-sdk (Edge Runtime)
run: pnpm --filter="livekit-server-sdk" test:edge
- name: Test rtc-node (Node)
run: pnpm --filter="@livekit/rtc-node" run test
env:
LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
- name: Test server sdk + rtc-node (Bun)
run: bun install && bun test --concurrent
build_and_release:
if: github.ref == 'refs/heads/main'
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build server SDK
run: pnpm --filter="livekit-server-sdk" build
- name: Build rtc-node
run: pnpm --filter="@livekit/rtc-node" build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Server SDK Docs
if: steps.changesets.outputs.published == 'true'
run: pnpm --filter=livekit-server-sdk build-docs
- name: S3 Upload Server SDK Docs
if: steps.changesets.outputs.published == 'true'
run: aws s3 cp packages/livekit-server-sdk/docs/ s3://livekit-docs/server-sdk-js --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: 'us-east-1'