Skip to content

Upload Python Package #6

Upload Python Package

Upload Python Package #6

name: Upload Python Package
on: workflow_dispatch
permissions:
contents: read
id-token: write # Allow GitHub to mint tokens
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest # Can use macos-latest if needed
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install setuptools
pip install twine
pip install wheel
sudo apt-get install jq
- name: Clean previous builds
run: rm -rf dist
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload --repository-url https://upload.pypi.org/legacy/ dist/*