Publish to PyPI #64
This file contains 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: 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/* | |
- name: Publish Package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |