Update shared pointers, SimilarityTransform3, CorrespondenceGraph (#162) #316
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: PyCOLMAP build and publish | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [ assigned, opened, synchronize, reopened ] | |
release: | |
types: [ published, edited ] | |
workflow_dispatch: | |
jobs: | |
linux-build: | |
name: Wrapper Linux Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pyversion: [ "cp38-cp38", "cp39-cp39", "cp310-cp310"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build the Linux wheels | |
run: | | |
# must be run in docker, cannot be run as freestanding script for toolchain issues | |
# run on old CentOS. but it's CentOS, so it's yum(RPM) not apt. very old glibc. glibc API is back-compatible but not forward. See https://github.com/pypa/manylinux | |
# see https://github.com/varunagrawal/docker-images/blob/master/gtsam-manylinux/Dockerfile for an example | |
# container, but it does not have some necesssary boost packages --> varunagrawal/gtsam-manylinux:latest | |
sudo docker run --rm -e PLAT=manylinux2014_x86_64 -e PYTHON_VERSION=${{ matrix.pyversion }} -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/package/build-wheels-linux.sh ${{ matrix.pyversion }} | |
# sudo docker run --rm -e PLAT=manylinux_2_24_x86_64 -e PYTHON_VERSION=${{ matrix.pyversion }} -v `pwd`:/io quay.io/pypa/manylinux_2_24_x86_64 /io/package/build-wheels-linux-new.sh ${{ matrix.pyversion }} | |
# cleanup for custom runner | |
sudo chown -R $(whoami):$(whoami) . | |
- name: Archive wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
# we strip the version number from the artifact name | |
name: pycolmap-${{ matrix.pyversion }}-manylinux2014_x86_64 | |
path: wheelhouse/pycolmap-*-${{ matrix.pyversion }}-*.whl | |
mac-build: | |
name: Wrapper macOS Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-11, macos-12 ] | |
pyversion: [ "[email protected]", "[email protected]", "[email protected]"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build the macOS wheels | |
run: | | |
./package/build-wheels-macos.sh ${{ matrix.pyversion }} | |
- name: Archive wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pycolmap-${{ matrix.pyversion }}-${{ matrix.os }} | |
path: ./wheelhouse/pycolmap-*.whl | |
pypi-publish: | |
name: Publish wheels to PyPI | |
needs: [ linux-build, mac-build ] | |
runs-on: ubuntu-latest | |
# We publish the wheel to pypi when a new tag is pushed, | |
# either by creating a new GitHub release or explictly with `git tag` | |
if: ${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags') }} | |
steps: | |
- name: Download wheels | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./artifacts/ | |
- name: Move wheels | |
run: mkdir ./wheelhouse && mv ./artifacts/**/*.whl ./wheelhouse/ | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip_existing: true | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: ./wheelhouse/ |