Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 0 additions & 15 deletions .changeset/config.json

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2026 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0

# Fails a contributor PR that changes a versioned package without a
# changeset, with a comment that links to a prefilled changeset file.
# The `internal` label skips the check.
name: Changeset check

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches: [main]

permissions:
contents: read
pull-requests: write

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: check
48 changes: 1 addition & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ env:
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
contents: read

on:
workflow_dispatch:
Expand Down Expand Up @@ -90,47 +88,3 @@ jobs:
bun install
(cd packages/livekit-server-sdk && EXPECT_BUN_RUNTIME=1 bun --bun run test)
(cd packages/livekit-rtc && EXPECT_BUN_RUNTIME=1 bun --bun run test)

build_and_release:
if: github.ref == 'refs/heads/main'
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0

- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
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@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
publish-script: 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'
29 changes: 29 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2026 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0

# On demand: open an rc PR from the branch the workflow is run on. The
# levels come from the changesets. Merging the PR tags 1.6.0-rc.1; the
# next run numbers rc.2. Changesets stay pending for the final release.
name: Pre-release PR

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # the tags number the rc
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: pre-release
args: --target ${{ github.ref_name }}
app-client-id: ${{ secrets.VERWALTER_RELEASE_CLIENT_ID }}
app-private-key: ${{ secrets.VERWALTER_RELEASE_APP_KEY }}
34 changes: 34 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2026 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0

# Keeps one release PR open while changesets are pending. Runs on every
# push to main and regenerates the release branch from main.
name: Release PRs

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

concurrency:
group: release-prs
cancel-in-progress: true

jobs:
pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # the commit that added a changeset gives its changelog line the PR and author
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: pr
# A GitHub App token lets the release PRs trigger CI; the default
# github.token does not. Without these secrets, github.token is used.
app-client-id: ${{ secrets.VERWALTER_RELEASE_CLIENT_ID }}
app-private-key: ${{ secrets.VERWALTER_RELEASE_APP_KEY }}
98 changes: 98 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# SPDX-FileCopyrightText: 2026 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0

# After a release PR merges: tag and create the GitHub releases, then
# publish to npm. The step that cannot be undone comes last.
name: Release

on:
# Any base branch: an rc PR from `pre-release` targets the branch it
# was run on. The bot and marker check on the job gates the run.
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
pull_request:
types: [closed]
# Re-run by hand after a fix: `verwalter release` resumes from the
# current state and skips what is done. With `package`, that package
# is reported again even when complete, so the publish job runs for it.
workflow_dispatch:
inputs:
package:
description: Only this package; always reported to the publish job.
required: false
default: ''

permissions:
contents: write
id-token: write # trusted publishing

jobs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: serialize release workflows without dropping pending releases

Could we serialize the whole release workflow? An older run can fetch tags before a newer release exists, finish after it, and publish to latest. With two separate tag snapshots, I verified that the pinned verwalter chooses the default npm tag for both versions, so the older publish can move latest backwards.

A shared concurrency group with queue: max and cancel-in-progress: false would prevent overlapping release runs while retaining queued runs. cancel-in-progress: false alone still allows a newly queued run to replace an existing pending run. Queueing does not itself guarantee release-version order, but it removes the concurrent execution window.

The previous workflow also lacked serialization, so this is optional hardening rather than a regression introduced here.

release:
# Only a release PR the tool opened: the branch prefix alone would let
# any pushed `release/*` branch trigger a publish.
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.user.login == 'verwalter-release[bot]' && contains(github.event.pull_request.body, '<!-- verwalter release -->'))
runs-on: ubuntu-latest
outputs:
released: ${{ steps.verwalter.outputs.released }}
releases: ${{ steps.verwalter.outputs.releases }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The merge commit itself: a push to main right after the merge
# must not move the tags.
ref: ${{ github.event.pull_request.merge_commit_sha || github.sha }}
fetch-depth: 0
- id: verwalter
uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: release
args: ${{ inputs.package && format('--package {0}', inputs.package) || '' }}

publish:
needs: release
if: needs.release.outputs.released == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write # the tool flips draft releases after the publish
id-token: write # trusted publishing
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.merge_commit_sha || github.sha }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Reject source/tag mismatches during manual recovery

A fresh manual dispatch on main checks out the branch's current SHA. If a failed publish left a release tag at commit A and the branch has advanced to B without another version bump, recovery can publish B's source under A's already-tagged version.

I validated this with the pinned verwalter v0.30.0: with the tag pointing to A and the same package version at B, both release --dry-run --package livekit-server-sdk and publish --dry-run accept the mismatch. The build steps here compile B before publishing.

Please reject a mismatch between the package's release tag and the checkout before building/publishing. Documenting recovery by re-running the original workflow or dispatching its original tag would also help operators choose the right source.

fetch-depth: 0 # tags decide what is published
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
# No registry-url: npm trusted publishing needs no token, and the
# placeholder token setup-node writes would make the publish fail.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24 # npm 11.5.1 or later is required for OIDC
cache: pnpm
- 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
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
env:
GH_TOKEN: ${{ github.token }}
with:
command: publish
releases: ${{ needs.release.outputs.releases }}

# The docs site holds one version: an rc must not replace it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: an rc?

Suggested change
# The docs site holds one version: an rc must not replace it.
# The docs site holds one version: a rc must not replace it.

- name: Check for a stable server SDK version
id: docs
run: |
version=$(node -p "require('./packages/livekit-server-sdk/package.json').version")
if [[ "$version" != *-* ]]; then echo "stable=true" >> "$GITHUB_OUTPUT"; fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Restrict stable documentation deployment to the appropriate server SDK release

A stable version in this checkout does not establish that this run released the server SDK or that this branch contains the current stable documentation. An RTC-only prerelease on a maintenance branch can leave the server SDK at an older stable version and overwrite the single unversioned documentation destination.

I ran this guard against the server SDK manifest from the real livekit-server-sdk@2.19.3 tag: it emits stable=true even with an RTC-only release handoff. Both documentation steps then run.

Please require an appropriate stable server SDK release in needs.release.outputs.releases and restrict this unversioned destination to the designated current release line. Other branches can skip deployment or use a versioned prefix; keep a way to retry a failed docs deployment.

# A failure here fails the job. A re-run is safe: publish skips the
# versions that npm already has.
- name: Build Server SDK Docs
if: steps.docs.outputs.stable == 'true'
run: pnpm --filter=livekit-server-sdk build-docs
- name: S3 Upload Server SDK Docs
if: steps.docs.outputs.stable == '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'
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"build": "turbo run build",
"build:livekit-rtc": "turbo run build --filter=@livekit/rtc-node...",
"build:artifacts": "turbo run artifacts --filter=@livekit/rtc-node...",
"ci:publish": "changeset publish",
"api:check": "turbo run api:check",
"api:update": "turbo run api:update",
"format:check": "prettier --check \"**/src/**/*.{ts,tsx,md,json}\"",
Expand All @@ -19,8 +18,6 @@
"test:watch": "vitest"
},
"devDependencies": {
"@changesets/cli": "^3.0.0",
"@livekit/changesets-changelog-github": "^0.2.0",
"@rushstack/heft": "^0.74.5",
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^8.60.1",
Expand Down
4 changes: 0 additions & 4 deletions packages/livekit-server-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"build": "tsup --onSuccess \"tsc -p tsconfig.json --declaration --emitDeclarationOnly --skipLibCheck\"",
"build:watch": "tsc --watch",
"build-docs": "typedoc",
"changeset": "changeset",
"ci:publish": "pnpm build && changeset publish",
"lint": "eslint src",
"format": "prettier --write src",
"format:check": "prettier --check src",
Expand All @@ -49,9 +47,7 @@
"jose": "^5.1.2"
},
"devDependencies": {
"@changesets/cli": "^3.0.0",
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
"@edge-runtime/vm": "^5.0.0",
"@livekit/changesets-changelog-github": "^0.2.0",
"@types/node": "^20.10.1",
"happy-dom": "^21.0.0",
"prettier": "^3.0.0",
Expand Down
Loading
Loading