Build package #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build package | |
on: | |
workflow_call: | |
inputs: | |
package: | |
required: true | |
type: string | |
artifact_name: | |
required: true | |
type: string | |
workflow_dispatch: | |
inputs: | |
package: | |
description: 'Name of the package to build' | |
required: true | |
default: 'livekit-plugins-browser' | |
artifact_name: | |
description: 'Artifact name for the distribution package' | |
required: true | |
default: 'build-artifact' | |
jobs: | |
build_plugins: | |
runs-on: ubuntu-latest | |
if: | | |
inputs.package == 'livekit-agents' || | |
inputs.package == 'livekit-plugins-azure' || | |
inputs.package == 'livekit-plugins-cartesia' || | |
inputs.package == 'livekit-plugins-deepgram' || | |
inputs.package == 'livekit-plugins-elevenlabs' || | |
inputs.package == 'livekit-plugins-google' || | |
inputs.package == 'livekit-plugins-minimal' || | |
inputs.package == 'livekit-plugins-nltk' || | |
inputs.package == 'livekit-plugins-openai' || | |
inputs.package == 'livekit-plugins-rag' || | |
inputs.package == 'livekit-plugins-silero' || | |
inputs.package == 'livekit-plugins-anthropic' | |
defaults: | |
run: | |
working-directory: "${{ startsWith(inputs.package, 'livekit-plugin') && 'livekit-plugins/' || '' }}${{ inputs.package }}" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
run: python -m build | |
- name: Upload distribution package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ inputs.artifact_name }} | |
path: "${{ startsWith(inputs.package, 'livekit-plugin') && 'livekit-plugins/' || '' }}${{ inputs.package }}/dist/" | |
build_browser: | |
if: inputs.package == 'livekit-plugins-browser' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-14] # TODO(theomonnom): other platforms | |
defaults: | |
run: | |
working-directory: livekit-plugins/livekit-plugins-browser | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install --upgrade pip | |
pip install cibuildwheel | |
- name: Build wheels | |
run: cibuildwheel --output-dir dist | |
env: | |
CIBW_SKIP: pp* cp313-* | |
CIBW_BUILD_VERBOSITY: 3 | |
- name: Upload distribution package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ inputs.artifact_name }} | |
path: livekit-plugins/livekit-plugins-browser/dist/ |