forked from koush/scrypted
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.38 KB
/
Copy pathpython-sdk.yml
File metadata and controls
47 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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