Skip to content

Publish Python 🐍 distributions 📦 #70

Publish Python 🐍 distributions 📦

Publish Python 🐍 distributions 📦 #70

name: Publish Python 🐍 distributions 📦
on:
release:
types: [published]
jobs:
build-and-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m ensurepip
pip install build --user
python -m build --wheel --sdist --outdir dist/
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}