Skip to content

Merge branch 'master' of github.com:nmwsharp/potpourri3d #65

Merge branch 'master' of github.com:nmwsharp/potpourri3d

Merge branch 'master' of github.com:nmwsharp/potpourri3d #65

Workflow file for this run

name: Build
# Run on the main branch and on tags (note conditional below)
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
jobs:
build_wheels:
# Only run if the commit message contains '[ci build]' OR always run if it's a tag
# This will not respect the tag if it appears in a pull request commit message. Those builds always show up as 'synchronize' events, and there is no easy way to get the corresponding commit messages. We instead pull the PR title to check for tags.
# More info here: https://git.luolix.topmunity/t/accessing-commit-message-in-pull-request-event/17158/13
if: "contains(toJSON(github.event.commits.*.message), '[ci build]') || contains(toJSON(github.event.pull_request.title), '[ci build]') || contains(github.ref, 'refs/tags')"
strategy:
matrix:
include:
- runs-on: ubuntu-latest
cibw-arch: manylinux_x86_64
- runs-on: ubuntu-latest
cibw-arch: manylinux_i686
- runs-on: macos-latest
cibw-arch: macosx_x86_64
- runs-on: macos-latest
cibw-arch: macosx_arm64
- runs-on: macos-latest
cibw-arch: macosx_universal2
- runs-on: windows-latest
cibw-arch: win_amd64
- runs-on: windows-latest
cibw-arch: win32
python-arch: x86
name: Build wheels ${{ matrix.cibw-arch }}
runs-on: ${{ matrix.runs-on }}
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_BUILD_LINUX : "yum remove -y cmake && python -m pip install cmake"
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.19.1
- name: Configure cibuildwheel
shell: bash
run: |
CMAKE_ARCH="${{ matrix.cibw-arch == 'win32' && '-A Win32' || '' }}"
CMAKE_OSX_ARCHITECTURES=${{ matrix.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.cibw-arch == 'macosx_universal2' && '"arm64;x86_64"' || '' }}
echo "CIBW_ARCHS_MACOS=x86_64 arm64 universal2" >> $GITHUB_ENV
echo "CIBW_BUILD=*-${{ matrix.cibw-arch }}" >> $GITHUB_ENV
echo "CIBW_ENVIRONMENT_MACOS=CMAKE_OSX_ARCHITECTURES=\"$CMAKE_OSX_ARCHITECTURES\"" >> $GITHUB_ENV
- name: Package source distribution
if: runner.os == 'Linux'
run: |
python setup.py sdist -d wheelhouse --formats=gztar
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
# Upload binaries to github
- uses: actions/upload-artifact@v2
with:
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
# Push the resulting binaries to pypi on a tag starting with 'v'
upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
# To test: repository_url: https://test.pypi.org/legacy/