mirror of
https://github.com/vee1e/lancelot.git
synced 2026-09-01 18:57:09 +00:00
zydis 3.x bundles an old zydis-c with cmake_minimum_required < 3.5. Newer CMake versions reject this, so we set CMAKE_POLICY_VERSION_MINIMUM=3.5 as a workaround.
142 lines
4.6 KiB
YAML
142 lines
4.6 KiB
YAML
on:
|
|
release:
|
|
types: [created, edited]
|
|
pull_request:
|
|
types: [opened, reopened]
|
|
workflow_dispatch: # manual trigger for testing builds
|
|
|
|
name: Python Wheels
|
|
|
|
jobs:
|
|
# derived from pydantic-core build:
|
|
# https://github.com/pydantic/pydantic-core/blob/8568136ee9abdca8a1c8b631750a4896bb25522e/.github/workflows/ci.yml#L399
|
|
build:
|
|
name: build for ${{ matrix.os }} / ${{ matrix.target }} / ${{ matrix.interpreter }}
|
|
# run on release, manual trigger, or if PR has label "Full Build"
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Full Build')
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
# placeholder matrix, so the various cases are explicitly listed below
|
|
os: [foo]
|
|
target: [foo]
|
|
manylinux: [foo]
|
|
exclude:
|
|
- os: foo
|
|
target: foo
|
|
manylinux: foo
|
|
|
|
include:
|
|
#
|
|
# Linux
|
|
#
|
|
- os: linux
|
|
manylinux: auto
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 pypy3.10
|
|
target: x86_64
|
|
- os: linux
|
|
manylinux: auto
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 pypy3.10
|
|
target: aarch64
|
|
- os: linux
|
|
manylinux: auto
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 pypy3.10
|
|
target: i686
|
|
- os: linux
|
|
manylinux: auto
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 # no pypy
|
|
target: armv7
|
|
# not supported by zydis/zycore:
|
|
# target: ppc64le
|
|
# target: s390x
|
|
|
|
#
|
|
# macOS
|
|
#
|
|
- os: macos
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 pypy3.10
|
|
target: x86_64
|
|
- os: macos
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 pypy3.10
|
|
target: aarch64
|
|
|
|
#
|
|
# Windows
|
|
#
|
|
- os: windows
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 # no pypy
|
|
# pypy doesn't seem to link today? needs investigation
|
|
# https://github.com/williballenthin/lancelot/actions/runs/11592290081/job/32273843597
|
|
target: x86_64
|
|
- os: windows
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 # no pypy
|
|
target: i686
|
|
python-architecture: x86
|
|
- os: windows
|
|
interpreter: 3.10 3.11 3.12 3.13 3.14 # no pypy
|
|
target: aarch64
|
|
|
|
runs-on: ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest
|
|
env:
|
|
# zydis 3.x bundles an old zydis-c with cmake_minimum_required < 3.5
|
|
# newer CMake versions reject this, so we need to override the policy
|
|
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: set up python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.14'
|
|
architecture: ${{ matrix.python-architecture || 'x64' }}
|
|
|
|
- name: build pylancelot wheels
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
manylinux: ${{ matrix.manylinux }}
|
|
args: --release --out dist --interpreter ${{ matrix.interpreter }} --manifest-path=./pylancelot/Cargo.toml
|
|
rust-toolchain: stable
|
|
docker-options: -e CI -e CMAKE_POLICY_VERSION_MINIMUM
|
|
|
|
- name: build pyflirt wheels
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
manylinux: ${{ matrix.manylinux }}
|
|
args: --release --out dist --interpreter ${{ matrix.interpreter }} --manifest-path=./pyflirt/Cargo.toml
|
|
rust-toolchain: stable
|
|
docker-options: -e CI -e CMAKE_POLICY_VERSION_MINIMUM
|
|
|
|
- run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: pypi_files_${{ matrix.os }}_${{ matrix.target }}_${{ matrix.interpreter || 'all' }}_${{ matrix.manylinux }}
|
|
path: dist
|
|
|
|
publish:
|
|
name: publish to PyPI
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
needs: [build]
|
|
environment:
|
|
name: release
|
|
permissions:
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts/
|
|
- name: collect wheels
|
|
run: |
|
|
shopt -s globstar
|
|
rm -rf dist/
|
|
mkdir dist/
|
|
cp -r artifacts/**/*.whl dist/
|
|
- name: publish to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
skip-existing: true
|
|
verbose: true
|
|
print-hash: true
|