213 lines
5.6 KiB
YAML
213 lines
5.6 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
build_wheels_windows:
|
|
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
|
|
os: [windows-latest]
|
|
env:
|
|
CIBW_BUILD: ${{matrix.python_tag}}
|
|
CIBW_TEST_REQUIRES: pytest hypothesis pandas
|
|
CIBW_TEST_COMMAND: pytest {package}/tests
|
|
CIBW_BUILD_VERBOSITY: 3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
with:
|
|
output-dir: wheelhouse
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
build_wheels_macos:
|
|
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
|
|
os: [macos-latest]
|
|
env:
|
|
CIBW_BUILD: ${{matrix.python_tag}}
|
|
CIBW_TEST_REQUIRES: pytest hypothesis pandas
|
|
CIBW_TEST_COMMAND: pytest {package}/tests
|
|
CIBW_BUILD_VERBOSITY: 3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
with:
|
|
output-dir: wheelhouse
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
build_wheels_apple_silicon:
|
|
name: Build wheel on macos-latest/universal2+arm64/${{matrix.python_tag}}
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python_tag: ["cp38-*", "cp39-*", "cp310-*"]
|
|
env:
|
|
CIBW_BUILD: ${{matrix.python_tag}}
|
|
CIBW_ARCHS_MACOS: "universal2 arm64"
|
|
CIBW_BUILD_VERBOSITY: 3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
with:
|
|
output-dir: wheelhouse
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
build_wheels_manylinux:
|
|
name: Build wheels on ubuntu-latest/${{matrix.arch}}/${{matrix.python_tag}}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# disable s390x and ppc64le wheels while they are not provided by numpy
|
|
# arch: [auto, aarch64, ppc64le, s390x]
|
|
arch: [auto, aarch64]
|
|
python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
|
|
env:
|
|
CIBW_ARCHS_LINUX: ${{matrix.arch}}
|
|
CIBW_BUILD: ${{matrix.python_tag}}
|
|
CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x}"
|
|
CIBW_TEST_REQUIRES: pytest hypothesis pandas
|
|
CIBW_TEST_COMMAND: pytest {package}/tests
|
|
CIBW_BUILD_VERBOSITY: 3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- uses: docker/setup-qemu-action@v1
|
|
name: Set up QEMU
|
|
|
|
- name: Build wheel
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
with:
|
|
output-dir: wheelhouse
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
# Scikit-build fails to build on pypy
|
|
#build_wheels_pypy:
|
|
# name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
|
|
# runs-on: ${{ matrix.os }}
|
|
# strategy:
|
|
# fail-fast: false
|
|
# matrix:
|
|
# # numpy ships no wheels for pypy on mac os
|
|
# os: [ubuntu-latest, windows-latest]
|
|
# python_tag: ["pp37-*", "pp38-*"]
|
|
# env:
|
|
# CIBW_BUILD: ${{matrix.python_tag}}
|
|
# # activate tests when the fix for
|
|
# # https://foss.heptapod.net/pypy/pypy/-/issues/3413 is released
|
|
# CIBW_TEST_REQUIRES: pytest hypothesis pandas
|
|
# CIBW_TEST_COMMAND: pytest {package}/tests
|
|
# CIBW_BUILD_VERBOSITY: 3
|
|
#
|
|
# steps:
|
|
# - uses: actions/checkout@v2
|
|
# with:
|
|
# submodules: 'true'
|
|
#
|
|
# - uses: actions/setup-python@v2
|
|
#
|
|
# - name: Build wheels
|
|
# uses: pypa/cibuildwheel@v2.3.1
|
|
# with:
|
|
# output-dir: wheelhouse
|
|
#
|
|
# - name: Upload wheels
|
|
# uses: actions/upload-artifact@v2
|
|
# with:
|
|
# path: ./wheelhouse/*.whl
|
|
|
|
build_sdist:
|
|
name: Build source distribution
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Build sdist
|
|
run: |
|
|
pip3 install build; python3 -m build --sdist
|
|
# test whether tarball contains all files required for compiling
|
|
pip3 install dist/rapidfuzz-*.tar.gz
|
|
pip3 uninstall rapidfuzz --yes
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
path: dist/*.tar.gz
|
|
|
|
deploy-wheels:
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
needs: [build_wheels_windows, build_wheels_macos, build_wheels_apple_silicon, build_wheels_manylinux, build_sdist]
|
|
name: deploy wheels to pypi
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: artifact
|
|
path: dist
|
|
|
|
- uses: pypa/gh-action-pypi-publish@master
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.pypi_password }}
|