Pull updates from COLMAP (#164) #327
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: | |
platform: [ manylinux2014_x86_64 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build the Linux wheels | |
run: | | |
sudo docker run --rm -e PLAT=${{ matrix.platform }} -v `pwd`:/io quay.io/pypa/${{ matrix.platform }} /io/package/build-wheels-linux.sh | |
# 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.platform }} | |
path: wheelhouse/pycolmap-*.whl | |
mac-build: | |
name: Wrapper macOS Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-11, macos-12 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build the macOS wheels | |
run: | | |
./package/build-wheels-macos.sh | |
- name: Archive wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pycolmap-${{ 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/ |