Skip to content

Upload Python Package #15

Upload Python Package

Upload Python Package #15

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published]
workflow_dispatch: # run on request (no need for PR)
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Import GPG Key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --import --batch --yes --no-tty
- name: Build and sign distribution
run: |
python setup.py sdist bdist_wheel
gpg --detach-sign -a dist/*.tar.gz
gpg --detach-sign -a dist/*.whl
- name: Upload to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}