Skip to content
Closed
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
69 changes: 4 additions & 65 deletions .github/workflows/node-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,14 @@ permissions:

on:
workflow_dispatch:
inputs:
tag:
required: true
type: string
workflow_call:
inputs:
tag:
required: true
type: string

env:
CARGO_TERM_COLOR: always
TAG_NAME: ${{ inputs.tag || github.ref_name }}
APP_NAME: rtc-node

jobs:
bump_version:
runs-on: macos-15
outputs:
commit_sha: ${{ steps.commit.outputs.commit_long_sha }}
steps:
- uses: actions/checkout@v6

- 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

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

- name: Set package version from tag
working-directory: livekit-ffi-node-bindings
run: |
# Extract version from tag (e.g., rust-sdks/livekit-ffi@0.12.43 -> 0.12.43)
VERSION=$(echo "${{ env.TAG_NAME }}" | sed 's/.*@//')
echo "Setting package version to $VERSION"
npm version $VERSION --no-git-tag-version
pnpm run ci:version

- name: Add changes
id: commit
uses: EndBug/add-and-commit@v9
with:
add: '["**/package.json"]'
default_author: github_actions
message: bump livekit-ffi-node-binding version

build:
needs: bump_version
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -94,8 +46,6 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive
ref: ${{ needs.bump_version.outputs.commit_sha }}
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json
Expand Down Expand Up @@ -204,17 +154,13 @@ jobs:
path: livekit-ffi-node-bindings/native.*
if-no-files-found: error

commit_and_release:
needs: [bump_version, build]
name: Commit and Release
release:
needs: [build]
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- run: git fetch origin ${{ needs.bump_version.outputs.commit_sha }}

- run: git reset --hard ${{ needs.bump_version.outputs.commit_sha }}

- uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json
Expand All @@ -241,13 +187,6 @@ jobs:
name: js-bindings
path: livekit-ffi-node-bindings

- name: Add changes
uses: EndBug/add-and-commit@v9
with:
add: '["livekit-ffi-node-bindings/native.js", "livekit-ffi-node-bindings/native.d.ts"]'
default_author: github_actions
message: update js bindings for release

- name: Move artifacts
run: pnpm run ci:artifacts
working-directory: livekit-ffi-node-bindings
Expand All @@ -258,4 +197,4 @@ jobs:

- name: Publish
working-directory: livekit-ffi-node-bindings
run: pnpm publish -r
run: pnpm publish -r --no-git-checks
49 changes: 47 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ jobs:
if: ${{ needs.release-plz-release.outputs.ffi_tag != '' }}
uses: ./.github/workflows/node-builds.yml
needs: release-plz-release
with:
tag: ${{ needs.release-plz-release.outputs.ffi_tag }}

# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
Expand Down Expand Up @@ -128,3 +126,50 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}

- name: Checkout release-plz PR branch
id: checkout-pr
run: |
PR_BRANCH=$(gh pr list --author "github-actions[bot]" --state open --json headRefName --jq '[.[] | select(.headRefName | startswith("release-plz-"))][0].headRefName // empty')
if [ -z "$PR_BRANCH" ]; then
echo "No release-plz PR found, skipping"
echo "found=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "found=true" >> $GITHUB_OUTPUT
git fetch origin "$PR_BRANCH"
git checkout "$PR_BRANCH"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup pnpm
if: steps.checkout-pr.outputs.found == 'true'
uses: pnpm/action-setup@v4
with:
package_json_file: livekit-ffi-node-bindings/package.json

- name: Setup node
if: steps.checkout-pr.outputs.found == 'true'
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: livekit-ffi-node-bindings/pnpm-lock.yaml

- name: Update node package.json versions
if: steps.checkout-pr.outputs.found == 'true'
working-directory: livekit-ffi-node-bindings
run: |
pnpm install
FFI_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' ../livekit-ffi/Cargo.toml)
echo "Setting node package version to $FFI_VERSION"
npm version $FFI_VERSION --no-git-tag-version
pnpm run ci:version

- name: Add changes
if: steps.checkout-pr.outputs.found == 'true'
uses: EndBug/add-and-commit@v9
with:
add: '["livekit-ffi-node-bindings/package.json", "livekit-ffi-node-bindings/npm/*/package.json"]'
default_author: github_actions
message: bump node ffi bindings version
4 changes: 4 additions & 0 deletions livekit-ffi-node-bindings/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,8 @@ Cargo.lock
!.yarn/sdks
!.yarn/versions


# don't commit the build artifacts from napi
*.node
native.d.ts
native.js
17 changes: 0 additions & 17 deletions livekit-ffi-node-bindings/native.d.ts

This file was deleted.

Loading
Loading