Skip to content

Publish to PyPI #14

Publish to PyPI

Publish to PyPI #14

name: Publish to PyPI
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH # Ensure uv is in PATH
- name: Create virtual environment and install dependencies
run: |
uv venv .venv
uv pip install --venv .venv build twine # Install inside .venv
- name: Build package
run: .venv/bin/python -m build
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: .venv/bin/python -m twine upload dist/*