Skip to content

Publish to PyPI

Publish to PyPI #42

name: Publish to PyPI
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
release:
types: [created]
# For testing purpose, delete this trigger afterwards
# push:
# paths:
# - '.github/workflows/publish_to_pypi.yaml'
jobs:
build-and-publish:
name: Publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Deployment Tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install Project Dependencies
run: |
pip install -r requirements.txt
- name: Package Distribution
run: >-
python
setup.py
sdist
bdist_wheel
- name: Deploy Package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*