Skip to content

Build distribution

Build distribution #72

Workflow file for this run

name: Build distribution
on: [workflow_dispatch]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
ubuntu-24.04,
ubuntu-24.04-arm,
macOS-13, # macOS-13 x86_64
macos-13-xlarge, # macOS-13 arm64
macOS-14, # macOS-14 arm64
macos-14-large, # macOS-14 x86_64
macOS-15, # macOS-15 arm64
macos-15-large, # macOS-15 x86_64
]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: maxim-lobanov/setup-xcode@v1
if:
matrix.os == 'macOS-13' ||
matrix.os == 'macOS-13-xlarge' ||
matrix.os == 'macOS-14' ||
matrix.os == 'macOs-14-large' ||
matrix.os == 'macOS-15' ||
matrix.os == 'macOs-15-large'
with:
xcode-version: latest-stable
- name: Build package Ubuntu all
uses: pypa/[email protected]
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
with:
output-dir: wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: "
{ yum makecache && yum install -y boost-devel; } ||
{ apt-get update && apt-get install libboost-all-dev; }
"
CIBW_ARCHS_LINUX: "native"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
CIBW_SKIP: "pp* *musllinux*"
- name: Build package macOS 13
uses: pypa/[email protected]
if: matrix.os == 'macOS-13' || matrix.os == 'macOS-13-xlarge'
with:
output-dir: wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: 13.0
CIBW_BEFORE_ALL_MACOS:
brew update &&
brew upgrade cmake &&
brew install boost &&
pip install --upgrade pip
CIBW_ARCHS_MACOS: "native"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
- name: Build package macOS 14
uses: pypa/[email protected]
if: matrix.os == 'macOS-14' || matrix.os == 'macOS-14-large'
with:
output-dir: wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: 14.0
CIBW_BEFORE_ALL_MACOS:
brew update &&
brew upgrade cmake &&
brew install boost &&
pip install --upgrade pip
CIBW_ARCHS_MACOS: "native"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
- name: Build package macOS 15
uses: pypa/[email protected]
if: matrix.os == 'macOS-15' || matrix.os == 'macOS-15-large'
with:
output-dir: wheelhouse
env:
MACOSX_DEPLOYMENT_TARGET: 15.0
CIBW_BEFORE_ALL_MACOS:
brew update &&
brew upgrade cmake &&
brew install boost &&
pip install --upgrade pip
CIBW_ARCHS_MACOS: "native"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- name: Build sdist
env:
CIBW_PROJECT_REQUIRES_PYTHON: "3.9"
run: pip install --upgrade pip && pip install build && python -m build --sdist --outdir dist && touch dist/empty.txt
- uses: actions/upload-artifact@v4
with:
name: source-dist
path: |
dist/*.tar.gz
empty.txt
# upload_pypi:
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# if: github.event_name == 'push'
# # if: github.event_name == 'release' && github.event.action == 'published'
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: artifact
# path: dist
# - uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.pypi_test_password }}
# repository_url: https://test.pypi.org/legacy/
# verify_metadata: false