Skip to content

build arm mac wheels on arm macs #711

build arm mac wheels on arm macs

build arm mac wheels on arm macs #711

Workflow file for this run

name: Release
on:
push:
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags:
- "**"
pull_request:
paths:
- pyproject.toml
- setup.py
- buildutils/**
- .github/workflows/wheels.yml
- tools/install_libzmq.sh
- zmq/utils/*.h
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TWINE_NONINTERACTIVE: "1"
# CIBW_PRERELEASE_PYTHONS: "1"
jobs:
sdist:
permissions:
id-token: write
# environment: release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install dependencies
run: |
pip install --upgrade pip build pytest
pip install -r tools/wheel-requirements.txt
- name: build sdist
run: |
python -m build --sdist .
- uses: actions/upload-artifact@v4
with:
name: sdist
path: "dist/*.tar.gz"
if-no-files-found: error
- name: verify sdist files
run:
pytest -v tools/test_sdist.py
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
wheel:
permissions:
id-token: write
# environment: release
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
name: wheel-${{ matrix.name }}
env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
CIBW_SKIP: "${{ matrix.cibw.skip || '' }}"
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_x86_64_image || '' }}"
PREFIX: /tmp/zmq
PKG_CONFIG_PATH: /tmp/zmq/lib/pkgconfig
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
name: mac-cpython
cibw:
build: "cp*"
- os: macos-12
name: mac-pypy
cibw:
build: "pp*"
- os: macos-14
name: mac-arm
cibw:
arch: universal2
build: "cp*"
- name: manylinux-x86_64
cibw:
arch: x86_64
build: "*manylinux*"
- name: manylinux-i686
cibw:
arch: i686
build: "*manylinux*"
# additional manylinux variants, not specified in pyproject.toml:
# build with newer 2_28 for cpython >= 3.10, pypy 3.9
- name: manylinux-x86_64-2_28
cibw:
arch: x86_64
build: "cp31*-manylinux* pp39-manylinux*"
manylinux_x86_64_image: manylinux_2_28
- name: musllinux
cibw:
build: "*musllinux*"
- name: win32
os: windows-2019
architecture: x86
cibw:
build: "cp*win32"
- os: windows-2019
name: win-pypy
architecture: x64
cibw:
build: "pp*win_amd64"
- os: windows-2019
name: win_amd64
architecture: x64
cibw:
build: "cp*win_amd64"
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: ${{ matrix.architecture }}
- name: customize mac-arm-64
if: contains(matrix.os, 'macos') && matrix.cibw.arch
run: |
echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV"
- name: install dependencies
run: |
pip install --upgrade setuptools pip wheel
pip install -r tools/wheel-requirements.txt
- name: show environment
run: |
pip freeze
- name: list target wheels
run: |
python -m cibuildwheel . --print-build-identifiers
- name: build wheels
run: |
python -m cibuildwheel .
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.name }}
path: "wheelhouse/*"
if-no-files-found: error
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
with:
packages-dir: wheelhouse/