Skip to content
name: Release PyPI Package
on:
release:
types: [published]
jobs:
release_package:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
- name: Build a binary wheel and a source tarball.
run: pip install wheel && python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}