-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (76 loc) · 2.4 KB
/
build-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
name: Build
on:
push:
branches:
- main
- ci/*
tags:
- v*
jobs:
build-source-distribution:
name: Building source distribution
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: 3.7
- name: Build source distribution
run: |
python setup.py sdist
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: packages-source
path: dist
build-manylinux-wheels:
name: Build wheels on ${{ matrix.os }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: cp36* cp311* cp312* pp* *arm64 *i686 *win32 *musl* # scipy<1.11 is not built for musl
CIBW_BEFORE_BUILD_WINDOWS: pip install swig
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: bash {project}/ci/test.sh {project}
CIBW_TEST_COMMAND_WINDOWS: bash {project}\ci\test.sh {project}
# definitively skip testing emulated and cross-compiled architectures
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64 *-macosx_universal2:arm64"
with:
output-dir: dist
- uses: actions/upload-artifact@v3
with:
name: packages-manylinux
path: ./dist/*.whl
publish:
name: Publish distributions
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build-manylinux-wheels, build-source-distribution]
runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/[email protected]
with:
path: dist
- name: Restore original folder structure of dist
run: |
find dist -type f -exec mv {} dist/ \;
find dist/* -type d -exec rmdir {} \; || true
- name: Publish package to PyPi
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}