Skip to content

Build and Publish Wheels #31

Build and Publish Wheels

Build and Publish Wheels #31

Workflow file for this run

name: Publish Python Package
on:
push:
tags:
- 'v*' # Runs only when a new tag starting with "v" is pushed
jobs:
build-and-publish:
name: Build and Publish Package
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # Change to your required version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
- name: Verify uploaded package
run: pip install --no-cache-dir --index-url https://pypi.org/simple/ your-package-name