nomyo/.forgejo/workflows/publish.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2026-04-03 12:05:58 +02:00
name: Publish to PyPI
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
2026-04-12 15:55:39 +02:00
build-and-publish:
name: Build & Publish (${{ matrix.runner }}, py${{ matrix.python }})
runs-on: ${{ matrix.runner }}
2026-04-03 12:05:58 +02:00
container:
image: python:${{ matrix.python }}-bookworm
strategy:
matrix:
python: ["3.10", "3.11", "3.12"]
runner: [docker-amd64, docker-arm64]
2026-04-03 12:05:58 +02:00
steps:
- name: Checkout repository
run: |
git clone --depth=1 --branch "${{ github.ref_name }}" \
"https://oauth2:${{ github.token }}@bitfreedom.net/code/${{ github.repository }}.git" \
.
- name: Install build tools
2026-04-12 16:05:32 +02:00
run: |
apt-get update -qq && apt-get install -y patchelf
pip install build Cython twine auditwheel
- name: Build wheel
run: python -m build --wheel
2026-04-12 16:05:32 +02:00
- name: Repair wheel to manylinux
run: auditwheel repair dist/*.whl --wheel-dir wheelhouse/
2026-04-12 16:02:38 +02:00
- name: Check wheel metadata
2026-04-12 16:05:32 +02:00
run: twine check wheelhouse/*.whl
2026-04-12 16:02:38 +02:00
2026-04-03 12:05:58 +02:00
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
2026-04-12 16:05:32 +02:00
run: twine upload --verbose wheelhouse/*.whl