Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Build Wheels

# Only run on new tags starting with `v`
on:
push:
tags:
- 'v*'
on: push
# push:
# tags:
# - 'v*'

jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
os: [windows-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -25,6 +25,9 @@ jobs:
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*"
CIBW_BEFORE_BUILD_MACOS: python -m pip install numpy Cython pybind11 && brew install glm
CIBW_BEFORE_ALL_LINUX: curl -sL https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip > glm.zip && unzip -q glm.zip && cp -r glm/glm/ /usr/include/
CIBW_BEFORE_BUILD_WINDOWS: curl -sL https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip > glm.zip && unzip -q glm.zip
# CIBW_ENVIRONMENT_WINDOWS: "PIP_GLOBAL_OPTION=\"/I%GITHUB_WORKSPACE%\\glm\\glm\""
CIBW_ENVIRONMENT_WINDOWS: "PYDELATIN_INCLUDE_DIRS=./glm/glm"

- uses: actions/setup-python@v1
name: Install Python
Expand All @@ -35,6 +38,11 @@ jobs:
run: |
python -m pip install cibuildwheel==1.6.1

- name: Install Visual C++ for Python 2.7
if: startsWith(matrix.os, 'windows')
run: |
choco install vcpython27 -f -y

- name: Build wheel
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand All @@ -43,14 +51,6 @@ jobs:
with:
path: ./wheelhouse/*.whl

# - name: Publish wheels to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python -m pip install twine
# twine upload wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
Expand All @@ -73,7 +73,7 @@ jobs:
needs: [build_wheels, build_sdist]
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')
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:
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import sys
from pathlib import Path

import setuptools
from setuptools import Extension, find_packages, setup
Expand All @@ -25,6 +27,11 @@ def __str__(self):
get_pybind_include()
]

# Allow for adding include dir via environment variable
# This is helpful for Windows CI wheel builds
if os.getenv('PYDELATIN_INCLUDE_DIRS'):
path = os.getenv('PYDELATIN_INCLUDE_DIRS')
include_dirs.append(str(Path(path).resolve()))

ext_modules = [
Extension(
Expand Down