- Fix author metadata (name, email, URLs) - Add LICENSE file (MIT) - Add MANIFEST.in for proper sdist packaging - Add PyPI publish workflow (.gitea/workflows/publish.yml) - Add keywords for discoverability - Align python_requires to >=3.10 across setup.py and pyproject.toml
39 lines
883 B
YAML
39 lines
883 B
YAML
name: Publish to PyPI
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
GITEA_URL: https://git.example.com
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone repo
|
|
run: |
|
|
rm -rf $GITHUB_WORKSPACE/*
|
|
git clone --depth 1 $GITEA_URL/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
|
|
git -C $GITHUB_WORKSPACE checkout $GITHUB_SHA 2>/dev/null || true
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Publish to PyPI
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
run: twine upload dist/*
|