Skip to content

Manual Publish to PyPI #1

Manual Publish to PyPI

Manual Publish to PyPI #1

name: Manual Publish to PyPI
on:
workflow_dispatch:
inputs:
tag:
description: 'Version tag to publish (e.g. v0.2.0)'
required: true
type: string
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10' # Adjust as needed
- name: Fetch all tags
run: git fetch --tags
- name: Check out the specified tag
run: git checkout ${{ github.event.inputs.tag }}
- name: Install build tools
run: pip install --upgrade build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}