Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ jobs:
- name: Install VA-API/NVIDIA drivers for linux x64 build
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
run: |
sudo apt install -y libva-dev libdrm-dev libnvidia-compute-570 libnvidia-decode-570 nvidia-cuda-dev -y
- name: Install Rust toolchain.
run: |
rustup target add ${{ matrix.target }}
- uses: Swatinem/[email protected]

- name: Build (Cargo)
if: ${{ !contains(matrix.target, 'android') }}
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ffi-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ jobs:
run: |
rustup target add ${{ matrix.target }}

- uses: Swatinem/[email protected]

- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
Expand Down Expand Up @@ -209,11 +211,6 @@ jobs:
name: ffi-builds-${{ matrix.target }}
path: ${{ matrix.name }}.zip

build_node:
name: Build node bindings
runs-on: ubuntu-latest
steps:

release:
name: Release to GH (Draft)
runs-on: ubuntu-latest
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/gen-node-proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Generate FFI Proto (Node)

on:
pull_request:
branches:
- main
paths:
- livekit-ffi/**
- livekit-ffi-node-bindings/**
workflow_dispatch:
workflow_call:

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: false

env:
PACKAGE_DIR: ./livekit-ffi-node-bindings

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 }}

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

- uses: actions/checkout@v6
with:
submodules: recursive
- uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: livekit-ffi-node-bindings/pnpm-lock.yaml

- run: pnpm install

- name: generate JS stubs
run: ./generate_proto.sh

- name: Add changes
uses: EndBug/add-and-commit@v9
with:
add: '["livekit-ffi-node-bindings/src/proto"]'
default_author: github_actions
message: generated protobuf
63 changes: 35 additions & 28 deletions .github/workflows/node-builds.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: node ffi binding build
name: Node FFI binding build and release

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:
Expand Down Expand Up @@ -56,41 +55,33 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: livekit-ffi-node-bindings/pnpm-lock.yaml

- run: pnpm install
working-directory: livekit-ffi-node-bindings

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}

- uses: Swatinem/[email protected]

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

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
packages/livekit-ffi/.cargo-cache
packages/livekit-ffi/target/
key: ${{ matrix.target }}-cargo-${{ matrix.os }}

- name: Install dependencies
working-directory: livekit-ffi-node-bindings
run: pnpm install

- name: Build (Linux)
if: ${{ matrix.platform == 'linux' }}
run: |
Expand Down Expand Up @@ -166,36 +157,36 @@ jobs:

release:
needs: build
if: github.ref == 'refs/heads/main'
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json

- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: livekit-ffi-node-bindings/pnpm-lock.yaml

- name: Install dependencies
- working-directory: livekit-ffi-node-bindings
run: pnpm install

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

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: livekit-ffi-node-bindings/artifacts

- name: Move artifacts
run: pnpm artifacts
working-directory: livekit-ffi-node-bindings

- name: List packages
run: ls -R ./livekit-ffi-node-bindings/npm
shell: bash

- name: Set package version from tag
working-directory: livekit-ffi-node-bindings
run: |
Expand All @@ -205,10 +196,26 @@ jobs:
npm version $VERSION --no-git-tag-version
pnpm run version

- name: Commit and push versioning changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: update livekit-ffi-node-bindings version to $(echo "${{ env.TAG_NAME }}" | sed 's/.*@//')" || echo "No changes to commit"
git push origin HEAD

- name: Build TS parts
working-directory: livekit-ffi-node-bindings
run: pnpm build:ts

- name: Move artifacts
run: pnpm artifacts
working-directory: livekit-ffi-node-bindings

- name: List packages
run: ls -R ./livekit-ffi-node-bindings/npm
shell: bash

- name: Publish
working-directory: livekit-ffi-node-bindings
run: pnpm publish --tag dev
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release

permissions:
id-token: write # Required for OIDC
pull-requests: write
contents: write
actions: write
Expand Down
6 changes: 5 additions & 1 deletion licenserc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ excludes = [
# Generated files
"livekit-protocol/src/livekit.rs",
"livekit-protocol/src/livekit.serde.rs",
"livekit-ffi-node-bindings/src/napi/native.cjs",
"livekit-ffi-node-bindings/src/napi/native.d.ts",
"livekit-ffi-node-bindings/src/napi/native.js",

]

[mapping.DOUBLESLASH_STYLE]
extensions = ["proto"]
extensions = ["proto", "ts", "js", "cjs"]

[mapping.SLASHSTAR_STYLE]
extensions = ["mm"]
Expand Down
2 changes: 1 addition & 1 deletion livekit-ffi-node-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"scripts": {
"build:ts": "tsup --onSuccess \"tsc --declaration --emitDeclarationOnly\" && cp -r src/napi dist/ && cp -r src/napi/* dist/",
"build": "./generate_proto.sh && pnpm build:ts && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
Copy link
Member

Choose a reason for hiding this comment

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

we don't need this step anymore? when doing local dev?

Copy link
Contributor Author

@lukasIO lukasIO Jan 13, 2026

Choose a reason for hiding this comment

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

I added this part in the previous PR, but running it like this errors out on windows builds, so I kept it as a separate/manual step in the CI as it was before

"build": "pnpm build:ts && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
"artifacts": "pnpm build:ts && napi artifacts",
"build:debug": "napi build --platform",
"universal": "napi universal",
Expand Down
28 changes: 13 additions & 15 deletions livekit-ffi-node-bindings/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*
* Copyright 2025 LiveKit, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2025 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
//
Expand Down
Loading
Loading