Skip to content

👷(pypi) add workflow to publish package #1

👷(pypi) add workflow to publish package

👷(pypi) add workflow to publish package #1

Workflow file for this run

name: Build and Publish to PyPI
on:
push:
# tags:
# - 'v*' # Trigger on version tags like v1.0.0
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history for proper versioning
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check distribution
run: twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# Use TestPyPI for testing
repository-url: https://test.pypi.org/legacy/