Skip to content

Publish package on PyPI #2

Publish package on PyPI

Publish package on PyPI #2

Workflow file for this run

name: Publish package on PyPI
on:
push:
tags:
- "v*.*.*" # Triggers the workflow on version tags (e.g., v1.0.0)
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install hatch
- name: Build package
run: hatch build
# - name: Publish package to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: hatch publish --user __token__
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install twine
python -m twine upload dist/*