feat: add CI/CD workflows for npm and PyPI auto-publish on tag

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Vectry
2026-02-11 00:33:24 +00:00
parent f4185364d5
commit 9e6f6337c0
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
name: Publish PyPI package
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
run: |
echo "VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//')" >> $GITHUB_ENV
- name: Update version in pyproject.toml
run: |
cd packages/sdk-python
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
- name: Build and publish to PyPI
run: |
cd packages/sdk-python
pip install build twine
python -m build
twine upload dist/*