Skip to content

CI: Add wheel build for macOS #36

CI: Add wheel build for macOS

CI: Add wheel build for macOS #36

Workflow file for this run

name: Python wheels
on:
pull_request:
push:
branches:
- ci-macos
tags:
- "*"
jobs:
sdist:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install libfuse-dev and pkg-config
run: sudo apt install -y libfuse-dev pkg-config
- name: Install Python build dependencies
run: python -m pip install --upgrade build
- 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
retention-days: 2
wheel:
runs-on: ${{ matrix.os }}
env:
TAGS: cp310-cp310 cp311-cp311 cp312-cp312
strategy:
matrix:
# os:
# - ubuntu-20.04
# target:
# # https://quay.io/organization/pypa
# - [ manylinux_2_28, x86_64 ]
# - [ manylinux_2_28, aarch64 ]
include:
- os: macos-latest
target:
- macosx-10.13-universal2
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Build Python manylinux wheels
if: runner.os == 'Linux'
env:
POLICY: ${{ matrix.target[0] }}
PLATFORM: ${{ matrix.target[1] }}
run: make manylinux POLICY="$POLICY" PLATFORM="$PLATFORM" TAGS="$TAGS"
- name: Install build deps (macOS)
if: runner.os == 'macOS'
run: |
brew list | grep python
which pip python
python --version
brew install --cask macfuse
pip install build
- name: Build Python macOS wheels
if: runner.os == 'macOS'
run: python -m build --wheel --outdir wheelhouse
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ join(matrix.target, '-') }}
path: wheelhouse/*.whl
if-no-files-found: error
retention-days: 2
merge-artifacts:
name: Download and create one artifact from all jobs
needs:
- sdist
- wheel
runs-on: ubuntu-20.04
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
path: dist
name: sdist
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheels-*
merge-multiple: true
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
if-no-files-found: error