name: Python wheels
on:
workflow_dispatch:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
linux:
name: Wheel (${{ matrix.plataforma }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
plataforma: linux-x64
imagen: quay.io/pypa/manylinux2014_x86_64:latest
- os: ubuntu-24.04-arm
plataforma: linux-arm64
imagen: quay.io/pypa/manylinux2014_aarch64:latest
steps:
- uses: actions/checkout@v4
- name: Construir manylinux2014
run: |
docker run --rm -v "$PWD:/io" -w /io \
${{ matrix.imagen }} \
bash -c '
set -euo pipefail
curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
. "$HOME/.cargo/env"
/opt/python/cp310-cp310/bin/python -m pip install --upgrade pip "maturin==1.16.0"
/opt/python/cp310-cp310/bin/python -m maturin build --release --out /io/dist --compatibility manylinux2014 --manifest-path /io/python/Cargo.toml
'
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.plataforma }}
path: dist/*.whl
wheels:
name: Wheel (${{ matrix.plataforma }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
plataforma: windows-x64
- os: windows-11-arm
plataforma: windows-arm64
- os: macos-15-intel
plataforma: macos-intel
- os: macos-latest
plataforma: macos-arm64
steps:
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
args: --release --out dist --compatibility pypi --manifest-path python/Cargo.toml
manylinux: auto
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.plataforma }}
path: dist/*.whl
sdist:
name: Sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path python/Cargo.toml
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
release:
name: Adjuntar al release
if: startsWith(github.ref, 'refs/tags/')
needs: [wheels, linux, sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: dist/*