mirror of https://github.com/koide3/small_gicp.git
Wheels (#51)
Build wheels (linux/windos/macos) and upload them to pypi.
This commit is contained in:
parent
308da3e371
commit
6206c44fc3
|
|
@ -0,0 +1,77 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
paths-ignore: '**.md'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_wheels:
|
||||||
|
name: Build wheels on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-14]
|
||||||
|
pyver: [cp38, cp39, cp310, cp311, cp312]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
|
- if: runner.os == 'Windows'
|
||||||
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
|
||||||
|
- name: Install pytest and cibuildwheel
|
||||||
|
run: python -m pip install cibuildwheel==2.17.0
|
||||||
|
|
||||||
|
- name: Build wheels
|
||||||
|
run: python -m cibuildwheel --output-dir wheelhouse
|
||||||
|
env:
|
||||||
|
CIBW_BUILD: ${{ matrix.pyver }}-*
|
||||||
|
CIBW_ARCHS_LINUX: auto aarch64
|
||||||
|
# CIBW_ARCHS_LINUX: x86_64
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
||||||
|
path: ./wheelhouse/*.whl
|
||||||
|
|
||||||
|
build_sdist:
|
||||||
|
name: Build source distribution
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build sdist
|
||||||
|
run: pipx run build --sdist
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: cibw-sdist
|
||||||
|
path: dist/*.tar.gz
|
||||||
|
|
||||||
|
upload_pypi:
|
||||||
|
needs: [build_wheels, build_sdist]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment: pypi
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
# unpacks all CIBW artifacts into dist/
|
||||||
|
pattern: cibw-*
|
||||||
|
path: dist
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
repository-url: https://pypi.org/legacy/
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(small_gicp VERSION 0.0.1 LANGUAGES C CXX)
|
project(small_gicp VERSION 0.0.6 LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||||
|
|
@ -51,7 +51,7 @@ if(NOT Eigen3_FOUND)
|
||||||
)
|
)
|
||||||
add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
|
add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
|
||||||
set_target_properties(Eigen3::Eigen PROPERTIES
|
set_target_properties(Eigen3::Eigen PROPERTIES
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/Eigen3-src"
|
INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -141,7 +141,7 @@ endif()
|
||||||
|
|
||||||
# Python bindings
|
# Python bindings
|
||||||
if(BUILD_PYTHON_BINDINGS)
|
if(BUILD_PYTHON_BINDINGS)
|
||||||
find_package(Python COMPONENTS Interpreter Development REQUIRED)
|
find_package(Python COMPONENTS Interpreter Development)
|
||||||
find_package(pybind11 CONFIG REQUIRED)
|
find_package(pybind11 CONFIG REQUIRED)
|
||||||
|
|
||||||
pybind11_add_module(small_gicp_python
|
pybind11_add_module(small_gicp_python
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "small_gicp"
|
name = "small_gicp"
|
||||||
version = "0.0.1"
|
version = "0.0.6"
|
||||||
authors = [{name = "Kenji Koide", email = "k.koide@aist.go.jp"}]
|
authors = [{name = "Kenji Koide", email = "k.koide@aist.go.jp"}]
|
||||||
description = "Efficient and parallelized algorithms for fine point cloud registration"
|
description = "Efficient and parallelized algorithms for fine point cloud registration"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
@ -14,9 +14,6 @@ requires-python = ">=3.7"
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Homepage = "https://github.com/koide3/small_gicp"
|
Homepage = "https://github.com/koide3/small_gicp"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
|
||||||
test = ["pytest>=6.0"]
|
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
zip_safe = false
|
zip_safe = false
|
||||||
|
|
||||||
|
|
@ -31,8 +28,22 @@ BUILD_PYTHON_BINDINGS = true
|
||||||
BUILD_HELPER = false
|
BUILD_HELPER = false
|
||||||
BUILD_SHARED_LIBS = false
|
BUILD_SHARED_LIBS = false
|
||||||
|
|
||||||
|
[tool.cibuildwheel.linux]
|
||||||
|
before-all = "yum install -y libomp-devel"
|
||||||
|
|
||||||
|
[tool.cibuildwheel.macos]
|
||||||
|
before-all = "brew install eigen libomp"
|
||||||
|
environment = { OpenMP_ROOT="/opt/homebrew/opt/libomp" }
|
||||||
|
|
||||||
|
[tool.cibuildwheel.windows]
|
||||||
|
before-all = "choco install eigen -y"
|
||||||
|
test-command = "cd /d {project} && pytest {project}/src --color=yes -v"
|
||||||
|
|
||||||
[tool.cibuildwheel]
|
[tool.cibuildwheel]
|
||||||
|
manylinux-x86_64-image = "manylinux_2_28"
|
||||||
|
manylinux-aarch64-image = "manylinux_2_28"
|
||||||
build = "*"
|
build = "*"
|
||||||
skip = "pp*" # Don't build for PyPy
|
skip = "pp* *-win32 *_i686 *musllinux*" # Don't build for PyPy, Win32, i686
|
||||||
test-command = "pytest {project}/src --color=yes -v"
|
test-requires = "pytest numpy scipy"
|
||||||
|
test-command = "cd {project} && pytest {project}/src --color=yes -v"
|
||||||
build-verbosity = 1
|
build-verbosity = 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue