Skip to content

Build and Upload to PyPI #1

Build and Upload to PyPI

Build and Upload to PyPI #1

name: Build and Upload to PyPI
on:
push:
tags:
- 'v*.*.*' # Only run on version tags
workflow_dispatch: # Allow manual triggering
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build the package
run: |
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*