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:
32
.gitea/workflows/publish-pypi.yml
Normal file
32
.gitea/workflows/publish-pypi.yml
Normal 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/*
|
||||
Reference in New Issue
Block a user