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
22 changes: 22 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Fails a PR that changes the 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@v4
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: check
26 changes: 26 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# On demand: open an rc PR from the branch the workflow is run on. The
# level comes from the pending changesets. Merging the PR tags
# v2.2.0-rc.1, and 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@v4
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 }}
30 changes: 30 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Keeps one release PR open while changesets are pending. Runs on every
# push to main and regenerates the release branch from main.
name: Release PR

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

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

jobs:
pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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 PR start 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 }}
Comment thread
lukasIO marked this conversation as resolved.
Resolved
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# After the release PR merges: tag and create the GitHub release. The
# package is installed by git URL and tag, so the tag is the whole release.
# There is no build job and no publish job.
name: Release

on:
# No branch filter: an rc PR from pre-release.yml targets the branch it
# was run on. The job condition below decides which PRs release.
pull_request:
types: [closed]
# Re-run by hand after a fix: `verwalter release` resumes from the
# current state (tag, release) and skips what is done.
workflow_dispatch:

permissions:
contents: write

jobs:
release:
# Only a release PR the tool opened: the branch prefix alone would let
# any pushed `release/*` branch start a release. The author is the
# GitHub App of `app-client-id`. Without an App, it is github-actions[bot].
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
steps:
- uses: actions/checkout@v4
with:
# The merge commit itself: a push to main right after the merge
# must not move the tag.
ref: ${{ github.event.pull_request.merge_commit_sha || github.sha }}
fetch-depth: 0
- uses: livekit/verwalter@359985c1e5567b17ae84db0241fbb305c383f89e # v0.30.0
with:
command: release
app-client-id: ${{ secrets.VERWALTER_RELEASE_CLIENT_ID }}
app-private-key: ${{ secrets.VERWALTER_RELEASE_APP_KEY }}
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Scripts~/build_ffi_locally.sh <platform> [build_type]
### Other scripts in `Scripts~/`
- `download_libs.py` — downloads the prebuilt FFI binaries for all platforms; the release tag is pinned in `version.ini`
- `generate_proto.sh` — regenerates `Runtime/Scripts/Proto/` from the protobuf definitions in `client-sdk-rust~/livekit-ffi/protocol` (requires `protoc`)
- `build_docs.sh`, `prepare_release.py`, `unity_test_results_utils.py` — docs generation, release preparation, CI test-result parsing
- `prepare_release.py <ffi_version>` — updates the FFI: `version.ini`, the prebuilt binaries, the submodule and the generated protobuf code. It does not touch the SDK version
- `build_docs.sh`, `unity_test_results_utils.py` — docs generation, CI test-result parsing

### Run tests
Tests require a local LiveKit server running:
Expand Down Expand Up @@ -79,6 +80,9 @@ Key internal files:
- `Samples~/Meet` — more complete multi-participant example (LiveKit Meet-like), default project for `run_unity.sh`
- `Samples~/Agents` — connect to an agent and display the transcript

### Releases
[verwalter](https://github.com/livekit/verwalter) releases the package. Every PR that changes the package adds a changeset file in `.changeset/` (`verwalter changeset --level patch|minor|major`), or carries the `internal` label. Each push to `main` updates one release PR. Merging it bumps `package.json`, writes `CHANGELOG.md`, tags `vX.Y.Z` and creates the GitHub release. Never edit the version by hand.

### Rust Submodule
`client-sdk-rust~/` is a git submodule pointing to the shared Rust SDK. The `~` suffix tells Unity to ignore the directory.

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

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.

So this file will accumulate changelogs or just hold the ones from the last release? Is this a 1:1 copy from the changeset files in the end?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This will accumulate and end up looking like this https://github.com/livekit/client-sdk-js/blob/main/CHANGELOG.md


The notes for 2.1.1 and earlier are on the [releases page](https://github.com/livekit/client-sdk-unity/releases).
7 changes: 7 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ cd client-sdk-unity
```

Or you can import the Git url `https://github.com/livekit/client-sdk-unity.git` from the package manager.
If you want to use tagged release versions, use `https://github.com/livekit/client-sdk-unity.git#vX.X.X`, for example with `#v1.3.5`.
If you want to use tagged release versions, use `https://github.com/livekit/client-sdk-unity.git#vX.X.X`, for example with `#v2.1.1`.

### Using OpenUPM

Expand Down
20 changes: 2 additions & 18 deletions Scripts~/prepare_release.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import argparse
import configparser
import json
import os
from pathlib import Path
import shutil
Expand All @@ -12,18 +11,6 @@
REPO_ROOT = Path(__file__).resolve().parent.parent


def update_package_json(version):
print(f"\n=== Updating package.json to version {version} ===")
with open("package.json", "r") as f:
data = json.load(f)
data["version"] = version
data["changelogUrl"] = f"https://github.com/livekit/client-sdk-unity/releases/tag/v{version}"
with open("package.json", "w") as f:
json.dump(data, f, indent=2)
f.write("\n")
print("Done.")


def update_version_ini(ffi_version):
tag = f"livekit-ffi@v{ffi_version}"
print(f"\n=== Updating version.ini tag to {tag} ===")
Expand Down Expand Up @@ -70,7 +57,6 @@ def stage_all_changes():
print("\n=== Staging all changes ===")
subprocess.run([
"git", "add",
"package.json",
"version.ini",
"Runtime/Plugins",
"client-sdk-rust~",
Expand All @@ -82,14 +68,12 @@ def stage_all_changes():
def main():
os.chdir(REPO_ROOT)

parser = argparse.ArgumentParser(description="Prepare the repo for a new release.")
parser.add_argument("sdk_version", help="SDK version (e.g. 1.4.0)")
parser = argparse.ArgumentParser(description="Update the repo to a new FFI version. verwalter owns the SDK version.")
parser.add_argument("ffi_version", help="FFI version (e.g. 0.12.53)")
args = parser.parse_args()

print(f"Preparing release: SDK v{args.sdk_version}, FFI v{args.ffi_version}")
print(f"Updating FFI to v{args.ffi_version}")

update_package_json(args.sdk_version)
update_version_ini(args.ffi_version)
download_ffi_binaries()
update_submodule(args.ffi_version)
Expand Down
9 changes: 9 additions & 0 deletions verwalter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#:schema https://raw.githubusercontent.com/livekit/verwalter/main/schemas/v1.json

[packages."io.livekit.livekit-sdk"]
path = "."
versioning.files = [
"package.json",
{ path = "package.json", regex = 'releases/tag/v(?<version>[^"]+)' },
{ path = "README.md", regex = '`#v(?<version>\d[^`]*)`' },
Comment on lines +6 to +8

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.

Why is package.json listed here once standalone and once in the { path, regex } pattern? Is the standalone using a default regex?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

exactly. package.json -> version is covered as a well-known default.
Unity's package.json extensions also have the changeLogUrl which isn't part of the plain package.json manifest, so it gets its own regex expression. Jacob has some ideas to make this more robust in the future (regex could match multiple today without anyone noticing).

]
7 changes: 7 additions & 0 deletions verwalter.toml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading