-
Notifications
You must be signed in to change notification settings - Fork 72
133 lines (117 loc) · 4.21 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
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 for ${{ matrix.python-version }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
matrix:
buildplat:
- [ubuntu-22.04, manylinux_x86_64]
- [ubuntu-22.04, musllinux_x86_64]
- [ubuntu-22.04, manylinux_aarch64]
- [ubuntu-22.04, musllinux_aarch64]
# macOS build arm64 on x86_64 with cross-compiler
- [macos-12, macosx_x86_64]
python-version: [pp310, cp37, cp38, cp39, cp310, cp311, cp312]
exclude:
# pp310, cp37, cp38 on musllinux is not support
- buildplat: [ubuntu-22.04, musllinux_x86_64]
python-version: cp37
- buildplat: [ubuntu-22.04, musllinux_x86_64]
python-version: cp38
- buildplat: [ubuntu-22.04, musllinux_x86_64]
python-version: pp310
- buildplat: [ubuntu-22.04, musllinux_aarch64]
python-version: cp37
- buildplat: [ubuntu-22.04, musllinux_aarch64]
python-version: cp38
- buildplat: [ubuntu-22.04, musllinux_aarch64]
python-version: pp310
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
env:
# select
CIBW_BUILD: ${{ matrix.python-version }}-${{ matrix.buildplat[1] }}
# linux
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# manylinux2014 can't build on aarch64
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2
CIBW_ARCHS_LINUX: auto64 aarch64
CIBW_BEFORE_BUILD_LINUX: "{project}/ci/linux-deps"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64" && auditwheel repair -w {dest_dir} {wheel}'
# macos
CIBW_ARCHS_MACOS: auto64 arm64
CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps"
# build
CIBW_ENVIRONMENT: >-
CYVCF2_HTSLIB_CONFIGURE_OPTIONS="--enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate"
CYTHONIZE=1
CIBW_TEST_COMMAND: "{project}/ci/test"
# 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 == 'true' }}
uses: mxschmitt/action-tmate@v3
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build sdist
run: CYTHONIZE=1 python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-22.04
# 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@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}