Deploy to PyPI #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to PyPI | |
on: | |
push: | |
tags: | |
- "**" | |
workflow_dispatch: | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Build source package | |
run: | | |
pip install build | |
python -m build --sdist . | |
- name: Upload source package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: distribution | |
path: dist/ | |
publish: | |
name: Deploy to PyPI | |
runs-on: ubuntu-latest | |
needs: [build_sdist] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download source package | |
uses: actions/download-artifact@v4 | |
with: | |
name: distribution | |
path: dist/ | |
- name: Deploy to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |