Skip to content

Publish Python Package to PyPI #1

Publish Python Package to PyPI

Publish Python Package to PyPI #1

Workflow file for this run

name: Publish Python Package to PyPI
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build the package
run: |
python3 -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload -r testpypi dist/*
- name: Clean up
run: |
rm -rf dist build *.egg-info