-
Notifications
You must be signed in to change notification settings - Fork 72
145 lines (129 loc) · 5.15 KB
/
wheels.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Wheels
on:
push:
branches:
- main
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
schedule:
# run weekly on a Monday
- cron: '0 0 * * 1'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.7"
- name: Install cibuildwheel
run: |
python -m pip install -U cibuildwheel
- name: Build wheels for Linux
if: matrix.os == 'ubuntu-20.04'
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "pp* *i686* *musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_LINUX: "{project}/ci/linux-deps"
CIBW_TEST_COMMAND: "{project}/ci/test"
CIBW_ENVIRONMENT: "CYTHONIZE=1 LIBDEFLATE=1 LDFLAGS='-L/usr/lib64/openssl11' CPPFLAGS='-I/usr/include/openssl11' C_INCLUDE_PATH='/root/include' LIBRARY_PATH='/root/lib'"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: LD_LIBRARY_PATH='/root/lib' auditwheel repair -w {dest_dir} {wheel}
- name: Build wheels for Mac OS x86
if: matrix.os == 'macos-latest'
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "pp* *i686*"
CIBW_ARCHS_MACOS: "x86_64"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps"
CIBW_TEST_COMMAND: "{project}/ci/test"
CIBW_ENVIRONMENT: "CYTHONIZE=1 LIBDEFLATE=1 C_INCLUDE_PATH='/usr/local/include' LIBRARY_PATH='/usr/local/lib'"
# https://cibuildwheel.readthedocs.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=/usr/local/lib delocate-listdeps {wheel} &&
DYLD_LIBRARY_PATH=/usr/local/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
LDFLAGS: "-L/usr/local/opt/[email protected]/lib"
CPPFLAGS: "-I/usr/local/opt/[email protected]/include"
PKG_CONFIG_PATH: "/usr/local/opt/[email protected]/lib/pkgconfig"
- name: Build wheels for Mac OS arm64
# don't build with libdeflate, see https://github.com/brentp/cyvcf2/issues/252
if: matrix.os == 'macos-latest'
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "pp* *i686*"
CIBW_ARCHS_MACOS: "arm64"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-arm64-deps"
CIBW_TEST_COMMAND: "{project}/ci/test"
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_ENVIRONMENT: "CYTHONIZE=1 C_INCLUDE_PATH='/usr/local/include' LIBRARY_PATH='/usr/local/lib'"
# https://cibuildwheel.readthedocs.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=/usr/local/lib delocate-listdeps {wheel} &&
DYLD_LIBRARY_PATH=/usr/local/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
LDFLAGS: "-L/usr/local/opt/[email protected]/lib"
CPPFLAGS: "-I/usr/local/opt/[email protected]/include"
PKG_CONFIG_PATH: "/usr/local/opt/[email protected]/lib/pkgconfig"
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
if: ${{ always() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.7"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libbz2-dev liblzma-dev libssl-dev
git submodule update --init --recursive
cd htslib
autoheader && autoconf && autoreconf --install
./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2
make
cd ..
pip install -r requirements.txt
- name: Build sdist
run: CYTHONIZE=1 python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
upload_pypi:
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')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}