Skip to content

chore(ci): add ci and pypi #1

chore(ci): add ci and pypi

chore(ci): add ci and pypi #1

Workflow file for this run

name: Publish Python Package to PyPI
on:
push:
tags:
- 'v*.*.*' # Trigger on tags like v0.1.0, v1.2.3
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install build dependencies
run: uv pip install build --system # Install build globally in the runner
- name: Build package
run: uv run python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No need for with: password: ${{ secrets.PYPI_API_TOKEN }} if using trusted publishing
# Ensure you have configured trusted publishing for this repository on PyPI.
# If not using trusted publishing, uncomment the line above and add a PYPI_API_TOKEN secret.