Skip to content

[pre-commit.ci] pre-commit autoupdate #139

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #139

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types: [published]
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
name: Build wheels (${{ matrix.python.version }}) on ${{ matrix.platform.os }}/${{ matrix.platform.arch }}
runs-on: ${{ matrix.platform.os }}-latest
strategy:
fail-fast: false
matrix:
platform:
- os: Ubuntu
arch: x86_64
- os: macOS
arch: x86_64
- os: macOS
arch: arm64
python:
- version: "3.8"
cp: cp38
- version: "3.9"
cp: cp39
- version: "3.10"
cp: cp310
- version: "3.11"
cp: cp311
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.9.0
env:
CIBW_BUILD: ${{ matrix.python.cp }}-*
CIBW_SKIP: "*-musllinux_*"
CIBW_ARCHS: ${{ matrix.platform.arch }}
CIBW_BEFORE_TEST_LINUX: |
yum install -y openmpi-devel
MPICC=/lib64/openmpi/bin/mpicc pip install mpi4py
CIBW_BEFORE_TEST_MACOS: brew install openmpi
CIBW_TEST_EXTRAS: dev
CIBW_TEST_COMMAND: pytest {package}/tests
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_all:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
password: ${{ secrets.PYPI_SECRET }}