'0419' #48
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: CI build for PyPI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: [3.11] | |
buildplat: | |
- platform: windows-2019 | |
manylinux_type: "" | |
os_name: win | |
arch: AMD64 | |
- platform: ubuntu-20.04 | |
manylinux_type: manylinux | |
arch: x86_64 | |
# - platform: ubuntu-20.04 | |
# manylinux_type: musllinux | |
# arch: x86_64 | |
python: [["cp36", "3.6"],["cp37", "3.7"],["cp38", "3.8"],["cp39", "3.9"],["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]] | |
runs-on: ${{ matrix.buildplat.platform }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install common dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install Cython numpy pybind11 scipy | |
- name: Install C++ compiler (Windows) | |
if: matrix.buildplat.os_name == 'win' | |
uses: msys2/setup-msys2@v2 | |
with: | |
install: mingw64/mingw-w64-x86_64-gcc | |
# - name: Install system dependencies | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y --no-install-recommends \ | |
# libblas-dev \ | |
# liblapack-dev | |
# 直接在env下设置环境变量 | |
- name: Set CIBW variables | |
run: | | |
echo "CIBW_BUILD=${{ format('{0}-{1}*', matrix.python[0], (matrix.buildplat.manylinux_type || matrix.buildplat.os_name)) }}" | |
echo "CIBW_ARCHS=${{ matrix.buildplat.arch }}" | |
env: | |
CIBW_BUILD: ${{ format('{0}-{1}*', matrix.python[0], (matrix.buildplat.manylinux_type || matrix.buildplat.os_name)) }} | |
CIBW_ARCHS: ${{ matrix.buildplat.arch }} | |
- name: Build wheels with cibuildwheel | |
shell: bash | |
env: | |
CIBW_BUILD: ${{ format('{0}-{1}*', matrix.python[0], (matrix.buildplat.manylinux_type || matrix.buildplat.os_name)) }} | |
CIBW_ARCHS: ${{ matrix.buildplat.arch }} | |
run: | | |
pip install cibuildwheel | |
if [ "${{ matrix.buildplat.platform }}" = "windows-2019" ]; then | |
cibuildwheel --output-dir wheelhouse --platform windows --arch ${{ matrix.buildplat.arch }} | |
else | |
cibuildwheel --output-dir wheelhouse --platform linux --arch ${{ matrix.buildplat.arch }} | |
fi | |
- name: Save Wheel Package as Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheelhouse | |
path: wheelhouse/*.whl |