Skip to content

Publish Python Package to PyPI #4

Publish Python Package to PyPI

Publish Python Package to PyPI #4

Workflow file for this run

name: Publish Python Package to PyPI
on:
workflow_dispatch:
release:
types: [ created ]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-20.04
environment: pypi-deployment
steps:
- uses: actions/checkout@v3
- name: "Set up Python 3.10"
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Publish to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run:
twine upload dist/*