mirror of
https://github.com/aphrody-labs/pyo3.git
synced 2026-10-14 12:39:13 +00:00
126 lines
3.9 KiB
YAML
126 lines
3.9 KiB
YAML
name: Build and release wheels
|
|
|
|
on:
|
|
merge_group:
|
|
types: [ checks_requested ]
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
pypi_linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
- uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
args: --release --out dist --compatibility pypi
|
|
manylinux: auto
|
|
working-directory: pyo3-introspection
|
|
- uses: astral-sh/setup-uv@v8.1.0
|
|
with:
|
|
save-cache: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
|
|
- run: uvx twine check pyo3-introspection/dist/*
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: wheels-linux-${{ matrix.target }}
|
|
path: pyo3-introspection/dist
|
|
|
|
pypi_windows:
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- runner: windows-latest
|
|
target: x64
|
|
- runner: windows-latest
|
|
target: x86
|
|
- runner: windows-11-arm
|
|
target: aarch64
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
- name: Build wheels
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.platform.target }}
|
|
args: --release --out dist --compatibility pypi
|
|
working-directory: pyo3-introspection
|
|
- uses: astral-sh/setup-uv@v8.1.0
|
|
with:
|
|
save-cache: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
|
|
- run: uvx twine check pyo3-introspection/dist/*
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: wheels-windows-${{ matrix.platform.target }}
|
|
path: pyo3-introspection/dist
|
|
|
|
pypi_macos:
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- runner: macos-15-intel
|
|
target: x86_64
|
|
- runner: macos-latest
|
|
target: aarch64
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
- uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.platform.target }}
|
|
args: --release --out dist --compatibility pypi
|
|
working-directory: pyo3-introspection
|
|
- uses: astral-sh/setup-uv@v8.1.0
|
|
with:
|
|
save-cache: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
|
|
- run: uvx twine check pyo3-introspection/dist/*
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: wheels-macos-${{ matrix.platform.target }}
|
|
path: pyo3-introspection/dist
|
|
|
|
pypi_sdist:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7.0.1
|
|
- uses: PyO3/maturin-action@v1
|
|
with:
|
|
command: sdist
|
|
args: --out dist
|
|
working-directory: pyo3-introspection
|
|
- uses: astral-sh/setup-uv@v8.1.0
|
|
with:
|
|
save-cache: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
|
|
- run: uvx twine check pyo3-introspection/dist/*
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: wheels-sdist
|
|
path: pyo3-introspection/dist
|
|
|
|
pypi_release:
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
permissions:
|
|
id-token: write
|
|
|
|
runs-on: ubuntu-latest
|
|
environment: release
|
|
needs: [pypi_linux, pypi_windows, pypi_macos, pypi_sdist]
|
|
steps:
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
pattern: wheels-*
|
|
path: pyo3-introspection/dist
|
|
merge-multiple: true
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
packages-dir: pyo3-introspection/dist
|