Skip to content

Release Python Package to PyPI #8

Release Python Package to PyPI

Release Python Package to PyPI #8

name: Release Python Package to PyPI
on:
release:
types: [published] # Trigger only when a release is published
workflow_dispatch: # Allows manual triggering
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for the latest commit
- name: Checkout distributables branch
run: git checkout distributables # Switch to the distributables branch
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}