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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,23 @@ jobs:
with:
name: server-log-${{ matrix.os }}
path: ${{ steps.server.outputs.log-path }}
if-no-files-found: error

test-version-input:
name: Test version input
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run pinned LiveKit server
id: server
uses: ./
with:
github-token: ${{ github.token }}
version: v1.13.3
- name: Upload server log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: server-log-version-input
path: ${{ steps.server.outputs.log-path }}
if-no-files-found: error
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ Install and run a LiveKit server in development mode for end-to-end testing.
- uses: livekit/dev-server-action@v1
with:
github-token: ${{ github.token }}
version: v1.13.3
```

## Inputs

| Name | Required | Default | Description |
| -------------- | -------- | ------- | -------------------------------------------------------------------- |
| `github-token` | Yes | | Token used to download the LiveKit server release. |
| `config` | No | `""` | Server configuration YAML
| Name | Required | Default | Description |
| -------------- | -------- | -------- | ------------------------------------------------------------------------ |
| `github-token` | Yes | | Token used to download the LiveKit server release. |
| `config` | No | `""` | Server configuration YAML |
| `version` | No | `latest` | LiveKit server release to install. Accepts `latest`, `v1.13.3`, or `1.13.3`. |

`version` is supported on Linux and Windows release downloads. macOS uses the
Homebrew package and only supports the latest version.

## Outputs

Expand Down
26 changes: 23 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
description: Server configuration YAML
required: false
default: ""
version:
description: LiveKit server release version to install. Use latest, v1.13.3, or 1.13.3.
required: false
default: latest
outputs:
pid:
description: Process ID
Expand All @@ -22,25 +26,41 @@ outputs:
runs:
using: composite
steps:
- name: Validate macOS version
if: runner.os == 'macOS' && inputs.version != 'latest' && inputs.version != ''
shell: bash
run: |
echo "::error::The version input is not supported on macOS because LiveKit does not publish macOS release artifacts. Use version: latest or omit the input."
exit 1
- name: Brew install
if: runner.os == 'macOS'
shell: bash
env:
HOMEBREW_NO_ENV_HINTS: 1
run: brew install livekit
- name: Resolve latest version
- name: Resolve version
if: runner.os == 'Linux' || runner.os == 'Windows'
id: version
shell: bash
env:
GH_TOKEN: ${{ inputs.github-token }}
LIVEKIT_VERSION: ${{ inputs.version }}
run: |
tag="$(gh api repos/livekit/livekit/releases/latest --jq '.tag_name')"
if [ -z "$LIVEKIT_VERSION" ] || [ "$LIVEKIT_VERSION" = "latest" ]; then
tag="$(gh api repos/livekit/livekit/releases/latest --jq '.tag_name')"
else
tag="$LIVEKIT_VERSION"
case "$tag" in
v*) ;;
*) tag="v$tag" ;;
esac
fi
if [ -z "$tag" ]; then
echo "::error::Failed to resolve version tag"
exit 1
fi
echo "Latest version tag: $tag"
gh release view "$tag" --repo livekit/livekit >/dev/null
echo "Version tag: $tag"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Download release artifact
if: runner.os == 'Linux' || runner.os == 'Windows'
Expand Down
Loading