Update version. #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build distribution | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macOS-11, macOS-12] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
if: matrix.os == 'macOS-11' || matrix.os == 'macOS-12' | |
with: | |
xcode-version: latest-stable | |
- name: Build package | |
uses: pypa/[email protected] | |
with: | |
output-dir: wheelhouse | |
env: | |
CIBW_BEFORE_ALL_MACOS: | |
brew update && | |
brew upgrade cmake && | |
brew install boost && | |
pip install --upgrade pip | |
CIBW_BEFORE_ALL_LINUX: " | |
{ yum makecache && yum install -y boost-devel; } || | |
{ apt-get update && apt-get install libboost-all-dev; } | |
" | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7, <3.11" | |
CIBW_SKIP: "pp* *-manylinux_i686 *-musllinux_*" | |
# TODO: Try to get builds to work on Python 3.8 | |
# - name: Build wheels on MacOS arm64 + Python 3.8 | |
# if: matrix.os == "macOS-11" | |
# uses: pypa/[email protected] | |
# with: | |
# output-dir: wheelhouse | |
# env: | |
# CIBW_BEFORE_ALL_MACOS: | |
# curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg && | |
# sudo installer -pkg /tmp/Python38.pkg -target / && | |
# sh "/Applications/Python 3.8/Install Certificates.command" && | |
# brew update && | |
# brew install boost | |
# CIBW_BEFORE_ALL_LINUX: yum install boost-devel | |
# CIBW_ARCHS_MACOS: arm64 | |
# CIBW_PROJECT_REQUIRES_PYTHON: "3.8" | |
# TODO: Find a solution for building ARM binaries on macOS. | |
# - name: Build wheels on MacOS arm64 + Python 3.9+ | |
# if: matrix.os == 'macOS-11' || matrix.os == 'macOS-12' | |
# uses: pypa/[email protected] | |
# with: | |
# output-dir: wheelhouse | |
# env: | |
# CIBW_BEFORE_ALL_MACOS: | |
# brew update && | |
# brew upgrade cmake && | |
# brew install boost && | |
# pip install --upgrade pip | |
# CIBW_ARCHS_MACOS: arm64 | |
# CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | |
# CIBW_SKIP: "pp* *-musllinux_*" | |
# CMAKE_OSX_ARCHITECTURES: arm64 | |
# CMAKE_APPLE_SILICON_PROCESSOR: arm64 | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
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 |