Skip to content

Deploy to PyPI

Deploy to PyPI #44

Workflow file for this run

# Create a tag (on devel) or create release
name: Deploy to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Check MANIFEST
run: |
check-manifest --verbose
- name: Build a wheel and a sdist
run: |
python -m build --outdir dist/ .
- name: Verify the distribution
run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
path: dist/*
publish:
needs: [deploy]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}