2222 APP_NAME : rtc-node
2323
2424jobs :
25+ bump_version :
26+ runs-on : macos-15
27+ outputs :
28+ commit_sha : ${{ steps.commit.outputs.commit_long_sha }}
29+ steps :
30+ - uses : actions/checkout@v6
31+
32+ - uses : pnpm/action-setup@v4
33+ with :
34+ package_json_file : livekit-ffi-node-bindings/package.json
35+
36+ - name : Setup node
37+ uses : actions/setup-node@v6
38+ with :
39+ node-version : 24
40+ cache : pnpm
41+ cache-dependency-path : livekit-ffi-node-bindings/pnpm-lock.yaml
42+
43+ - working-directory : livekit-ffi-node-bindings
44+ run : pnpm install
45+
46+ - name : Set package version from tag
47+ working-directory : livekit-ffi-node-bindings
48+ run : |
49+ # Extract version from tag (e.g., rust-sdks/livekit-ffi@0.12.43 -> 0.12.43)
50+ VERSION=$(echo "${{ env.TAG_NAME }}" | sed 's/.*@//')
51+ echo "Setting package version to $VERSION"
52+ npm version $VERSION --no-git-tag-version
53+ pnpm run ci:version
54+
55+ - name : Add changes
56+ id : commit
57+ uses : EndBug/add-and-commit@v9
58+ with :
59+ add : ' ["**/package.json"]'
60+ default_author : github_actions
61+ message : bump livekit-ffi-node-binding version
62+
2563 build :
64+ needs : bump_version
2665 strategy :
2766 fail-fast : false
2867 matrix :
5594 - uses : actions/checkout@v6
5695 with :
5796 submodules : recursive
97+ ref : ${{ needs.bump_version.outputs.commit_sha }}
98+ fetch-depth : 0
5899 - uses : pnpm/action-setup@v4
59100 with :
60101 package_json_file : livekit-ffi-node-bindings/package.json
@@ -147,20 +188,32 @@ jobs:
147188 working-directory : livekit-ffi-node-bindings
148189 run : pnpm build --target ${{ matrix.target }}
149190
150- - name : Upload artifact
191+ - name : Upload binary artifact
151192 uses : actions/upload-artifact@v4
152193 if : github.event_name != 'pull-request'
153194 with :
154- name : bindings-${{ matrix.target }}
155- path : livekit-ffi-node-bindings/src/napi/ ${{ env.APP_NAME }}.*.node
195+ name : native- bindings-${{ matrix.target }}
196+ path : livekit-ffi-node-bindings/${{ env.APP_NAME }}.*.node
156197 if-no-files-found : error
157198
158- release :
159- needs : build
160- name : Release
199+ - name : Upload JS
200+ uses : actions/upload-artifact@v4
201+ if : ${{ github.event_name != 'pull-request' && matrix.os == 'macos-15' }}
202+ with :
203+ name : js-bindings
204+ path : livekit-ffi-node-bindings/native.*
205+ if-no-files-found : error
206+
207+ commit_and_release :
208+ needs : [bump_version, build]
209+ name : Commit and Release
161210 runs-on : ubuntu-latest
162211 steps :
163- - uses : actions/checkout@v5
212+ - uses : actions/checkout@v6
213+
214+ - run : git fetch origin ${{ needs.bump_version.outputs.commit_sha }}
215+
216+ - run : git reset --hard ${{ needs.bump_version.outputs.commit_sha }}
164217
165218 - uses : pnpm/action-setup@v4
166219 with :
@@ -176,40 +229,27 @@ jobs:
176229 - working-directory : livekit-ffi-node-bindings
177230 run : pnpm install
178231
179- - name : Install Protoc
180- uses : arduino/setup-protoc@v3
181- with :
182- version : " 25.1"
183- repo-token : ${{ secrets.GITHUB_TOKEN }}
184-
185- - name : Download all artifacts
232+ - name : Download native build artifacts
186233 uses : actions/download-artifact@v4
187234 with :
235+ pattern : native-bindings-*
188236 path : livekit-ffi-node-bindings/artifacts
189237
190- - name : Set package version from tag
191- working-directory : livekit-ffi-node-bindings
192- run : |
193- # Extract version from tag (e.g., rust-sdks/livekit-ffi@0.12.43 -> 0.12.43)
194- VERSION=$(echo "${{ env.TAG_NAME }}" | sed 's/.*@//')
195- echo "Setting package version to $VERSION"
196- npm version $VERSION --no-git-tag-version
197- pnpm run version
198-
199- - name : Commit and push versioning changes
200- run : |
201- git config --global user.name "github-actions[bot]"
202- git config --global user.email "github-actions[bot]@users.noreply.github.com"
203- git add .
204- git commit -m "chore: update livekit-ffi-node-bindings version to $(echo "${{ env.TAG_NAME }}" | sed 's/.*@//')" || echo "No changes to commit"
205- git push origin HEAD
238+ - name : Download js artifacts
239+ uses : actions/download-artifact@v4
240+ with :
241+ name : js-bindings
242+ path : livekit-ffi-node-bindings
206243
207- - name : Build TS parts
208- working-directory : livekit-ffi-node-bindings
209- run : pnpm build:ts
244+ - name : Add changes
245+ uses : EndBug/add-and-commit@v9
246+ with :
247+ add : ' ["livekit-ffi-node-bindings/native.js", "livekit-ffi-node-bindings/native.d.ts"]'
248+ default_author : github_actions
249+ message : update js bindings for release
210250
211251 - name : Move artifacts
212- run : pnpm artifacts
252+ run : pnpm run ci: artifacts
213253 working-directory : livekit-ffi-node-bindings
214254
215255 - name : List packages
@@ -218,4 +258,4 @@ jobs:
218258
219259 - name : Publish
220260 working-directory : livekit-ffi-node-bindings
221- run : pnpm publish --tag dev
261+ run : pnpm publish -r
0 commit comments