increase version. #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Klavis AI Python SDK Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Trigger on tags like v0.1.0, v1.2.3, etc. | |
| permissions: | |
| contents: write # Needed to create GitHub releases | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: pypi # Add environment name | |
| # Only run this job if the tag matches the version in pyproject.toml | |
| # This requires an extra step to read the version, omitted for simplicity for now | |
| # Add validation if needed: https://github.com/marketplace/actions/check-python-versions | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' # Choose a Python version, adjust as needed | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools wheel twine build | |
| working-directory: ./sdks/python | |
| - name: Build package | |
| run: python -m build | |
| working-directory: ./sdks/python | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| packages_dir: sdks/python/dist/ | |
| # Optional: uncomment to publish to TestPyPI first | |
| # repository_url: https://test.pypi.org/legacy/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| # The release name will be the tag name (e.g., "v0.0.4") | |
| # The body will be auto-generated based on commits since the last tag | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |