-
Notifications
You must be signed in to change notification settings - Fork 28
95 lines (77 loc) · 2.76 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
# This workflow triggers when commit message contains "wheel" or when a tag is pushed.
# It will build a Python project using CIBW, then upload the wheel and source
# distribution to PyPI.
name: Build wheels
on:
push:
repository_dispatch:
types: [wheel]
jobs:
build_wheels:
name: Wheel on ${{ matrix.os }} for ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
if: ${{ startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, 'wheel') }}
strategy:
matrix:
os: [ubuntu-latest, macos-11]
python_version: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"]
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: >
curl https://sh.rustup.rs -sSf | sh -s -- -y && yum install -y openssl-devel zlib-devel
CIBW_ARCHS_LINUX: "auto64"
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_SKIP: "pp* *-win32 *-musllinux*"
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_TEST_REQUIRES: pytest hypothesis
CIBW_TEST_COMMAND: "pytest {project}/snapatac2-python/tests"
steps:
- name: Checkout code
uses: nschloe/action-cached-lfs-checkout@v1
- uses: ./.github/actions/setup-rust
- if: runner.os != 'Linux'
name: Setup env when not using docker
run: python -m pip install --upgrade wheel setuptools setuptools-rust
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.13.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse snapatac2-python
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
make_sdist:
name: Build source distribution
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Install setuptools and setuptools-rust
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust
- name: Build sdist
run: python setup.py sdist
working-directory: snapatac2-python
- uses: actions/upload-artifact@v3
with:
path: snapatac2-python/dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}