nomyo/.forgejo/workflows/publish.yml

62 lines
1.4 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:
build:
name: Build (${{ 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
run: pip install build Cython
- name: Build wheel
run: python -m build --wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: wheel-${{ matrix.runner }}-py${{ matrix.python }}
path: dist/*.whl
publish:
name: Publish to PyPI
needs: build
runs-on: docker-amd64
container:
image: python:3.12-bookworm
steps:
- name: Download all wheels
uses: actions/download-artifact@v3
with:
path: dist/
merge-multiple: true
2026-04-03 12:05:58 +02:00
- name: Install twine
run: pip install twine
2026-04-03 12:05:58 +02:00
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/**/*.whl