Skip to content

Publish PySpector to PyPI #1

Publish PySpector to PyPI

Publish PySpector to PyPI #1

# .github/workflows/publish-to-pypi.yml
name: Publish Python Package to PyPI
# This action runs on every new release published and has also a manual trigger
on:
workflow_dispatch:
release:
types: [published, prereleased]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Check out the repository's code
- name: Check out repository
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# Set up the Rust toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Install the Python build tool
- name: Install Python build dependencies
run: pip install build
# Build the package (sdist and platform-specific wheel)
- name: Build package
run: python -m build
# Publish the package to PyPI
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}