Skip to content
name: Publish Python Package 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@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Create .pypirc file
env:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
echo "[pypi]" >> ~/.pypirc
echo "username = __token__" >> ~/.pypirc
echo "password = $PYPI_PASSWORD" >> ~/.pypirc
- name: Build and publish
run: |
python setup.py sdist bdist_wheel
twine upload dist/*