Skip to content

Merge pull request #91 from nicolapace/main #34

Merge pull request #91 from nicolapace/main

Merge pull request #91 from nicolapace/main #34

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-12]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_ARCHS_LINUX: x86_64 i686
CIBW_BEFORE_ALL_LINUX: apt-get install libgmp3-dev || yum install -y gmp-devel || apk add --upgrade gmp-dev
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_ALL_MACOS: brew install gmp
- 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:
name: Publish package to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
username: __token__
password: ${{ secrets.PYPI_API_TOKEN }}