-
Notifications
You must be signed in to change notification settings - Fork 16
105 lines (95 loc) · 3.71 KB
/
package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Packaging
# on: [push]
on:
push:
tags:
- '*'
branches:
- package
jobs:
setup:
name: Build SWIG wrappers
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install numpy
run: python -m pip install numpy setuptools
- run: bash swig/python-packaging/setup.sh
- uses: actions/upload-artifact@v2
with:
name: my-artifact
path: build/swig/python-packaging/
- name: List
run: pwd && ls build/swig/python-packaging
build_wheels:
needs: setup
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.13.1
- uses: actions/download-artifact@v2
with:
name: my-artifact
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
# Use boost 1_72, since this allows c++11. We need c++11, since manylinux2014 only has gcc 4.8
# Can't use boost 1.53 (default on linux) because it doesn't have rtree functionality
# CIBW_BUILD: cp36-manylinux_x86_64 cp36-win_amd64 cp36-macosx_x86_64
# CIBW_BUILD: cp310-macosx_x86_64
# PyPy compilation on MACOS doesn't work, possibly since there is no available numpy release for this
# Armadillo isn't available for i687 on Centos 7, making compilation more complicated
# # Musllinux doesn't use yum as its package manager
CIBW_SKIP: pp*-macosx* *i686* *musllinux*
CIBW_BEFORE_ALL_LINUX: |
yum install -y lapack-devel armadillo-devel
curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
tar -xf boost_1_72_0.tar.gz
cd boost_1_72_0
cp -r boost /usr/include
CIBW_BEFORE_ALL_MACOS: |
# Other than the latest version, Brew only has boost 1.76. Therefore we must install boost from source
# brew reinstall gcc lapack gsl armadillo
brew reinstall lapack armadillo
curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
tar -xf boost_1_72_0.tar.gz
cd boost_1_72_0
cp -r boost /usr/local/include
# Link in gcc, otherwise the default Apple compiler will be used, which doesn't support openmp by default
# ln -s /usr/local/bin/gcc-13 /usr/local/bin/gcc
# ln -s /usr/local/bin/g++-13 /usr/local/bin/g++
# CIBW_ENVIRONMENT_MACOS: CC='/usr/local/bin/gcc' LDSHARED='/usr/local/bin/gcc' CXX='/usr/local/bin/g++'
CIBW_ENVIRONMENT_MACOS: CFLAGS='-Wno-c++11-narrowing'
CIBW_BEFORE_ALL_WINDOWS: choco install -y lapack-devel
CIBW_TEST_COMMAND: >
python {project}/tests/check_installation.py
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
pypi-publish:
needs: build_wheels
name: Upload release to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: wheelhouse
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/
name: pypi
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
url: https://pypi.org/p/gridpp
skip_existing: true