Skip to content

Publish Python 🐍 distribution 📦 to PyPI #5

Publish Python 🐍 distribution 📦 to PyPI

Publish Python 🐍 distribution 📦 to PyPI #5

Workflow file for this run

name: Deploy to PyPI
on:
workflow_dispatch:
# if we want deploy after each push
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build the package
run: |
python3 setup.py sdist bdist_wheel
- name: Check the package
run: |
twine check dist/*
- name: Deploy to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.deploy_to_pypi }}
run: |
twine upload dist/*