This is a prime candidate for a reusable workflow, since it boils down to:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build distributions
run: make dist
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
This flow will be even nicer when PyPI supports reusable workflows for publishing, which is something we're working on.