mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
* chore(deps): remove unused dependencies and harden CI supply chain Dependency cleanup: - Remove unused deps: papaparse, unified, and 6 unused Radix primitives (alert-dialog, radio-group, scroll-area, separator, toggle, visually-hidden) plus @tanstack/react-query-devtools (all verified zero imports repo-wide) - Consolidate jwt-decode into the existing jose dependency (decodeJwt) - Migrate react-window to @tanstack/react-virtual to drop a redundant virtualization library (terminal, structured-output, code viewer) - Remove the better-auth-harmony plugin and its gating env flag Supply-chain hardening: - SHA-pin every GitHub Action to a full commit SHA with a version comment - Pin CI bun-version to 1.3.13 (was "latest" in the release job) - Raise bun minimumReleaseAge cooldown from 3 to 7 days - Add a non-blocking `bun audit` step in CI - Add a CODEOWNERS gate routing dependency-manifest changes to @simstudioai/deps * chore(deps): remove unused apps/docs dependencies (@tabler/icons-react, dotenv-cli) * style(search-modal): use Send icon for Invite teammates action * feat(search-modal): surface New chat as the top action above Create workflow * feat(search-modal): add Secrets to the pages list
92 lines
3.1 KiB
YAML
92 lines
3.1 KiB
YAML
name: Publish Python SDK
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'packages/python-sdk/**'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
publish-pypi:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: '3.12'
|
|
cache: 'pip'
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine pytest requests tomli
|
|
|
|
- name: Run tests
|
|
working-directory: packages/python-sdk
|
|
run: |
|
|
PYTHONPATH=. pytest tests/ -v
|
|
|
|
- name: Get package version
|
|
id: package_version
|
|
working-directory: packages/python-sdk
|
|
run: echo "version=$(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Check if version already exists
|
|
id: version_check
|
|
run: |
|
|
if pip index versions simstudio-sdk | grep -q "${{ steps.package_version.outputs.version }}"; then
|
|
echo "exists=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "exists=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Build package
|
|
if: steps.version_check.outputs.exists == 'false'
|
|
working-directory: packages/python-sdk
|
|
run: python -m build
|
|
|
|
- name: Check package
|
|
if: steps.version_check.outputs.exists == 'false'
|
|
working-directory: packages/python-sdk
|
|
run: twine check dist/*
|
|
|
|
- name: Publish to PyPI
|
|
if: steps.version_check.outputs.exists == 'false'
|
|
working-directory: packages/python-sdk
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
run: twine upload dist/*
|
|
|
|
- name: Log skipped publish
|
|
if: steps.version_check.outputs.exists == 'true'
|
|
run: echo "Skipped publishing because version ${{ steps.package_version.outputs.version }} already exists on PyPI"
|
|
|
|
- name: Create GitHub Release
|
|
if: steps.version_check.outputs.exists == 'false'
|
|
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: python-sdk-v${{ steps.package_version.outputs.version }}
|
|
name: Python SDK v${{ steps.package_version.outputs.version }}
|
|
body: |
|
|
## Python SDK v${{ steps.package_version.outputs.version }}
|
|
|
|
Published simstudio-sdk==${{ steps.package_version.outputs.version }} to PyPI.
|
|
|
|
### Installation
|
|
```bash
|
|
pip install simstudio-sdk==${{ steps.package_version.outputs.version }}
|
|
```
|
|
|
|
### Documentation
|
|
See the [README](https://github.com/simstudioai/sim/tree/main/packages/python-sdk) or the [docs](https://docs.sim.ai/sdks/python) for more information.
|
|
draft: false
|
|
prerelease: false |