mirror of
https://github.com/koush/scrypted.git
synced 2026-08-03 03:40:45 +01:00
48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: Python SDK
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- "packages/python-client/**"
|
|
- "server/python/**"
|
|
- "sdk/types/scrypted_python/**"
|
|
- ".github/workflows/python-sdk.yml"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: packages/python-client
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v5
|
|
- name: Build sdist and wheel
|
|
run: uv build
|
|
- name: Smoke test the wheel
|
|
run: |
|
|
uv venv /tmp/smoke
|
|
uv pip install --python /tmp/smoke/bin/python dist/*.whl
|
|
/tmp/smoke/bin/python -c "import scrypted_sdk; from scrypted_sdk.types import VideoClip, LockState; print(scrypted_sdk.connect_scrypted_client, scrypted_sdk.PluginRemote, scrypted_sdk.ScryptedInterface.MotionSensor, VideoClip, LockState)"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: python-sdk-dist
|
|
path: packages/python-client/dist/
|
|
|
|
publish:
|
|
name: Publish to PyPI
|
|
if: github.event_name == 'workflow_dispatch'
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment: pypi
|
|
permissions:
|
|
id-token: write # PyPI trusted publishing
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: python-sdk-dist
|
|
path: dist/
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|