-
Notifications
You must be signed in to change notification settings - Fork 11
116 lines (100 loc) · 3.51 KB
/
build.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
name: Build wheels
on:
release:
types: [created, edited]
push:
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
- name: Install Python dependencies
run: |
python -m pip install --upgrade -r development.txt
- name: Install Windows dependencies
if: runner.os == 'Windows'
run: |
choco install golang -f -y
choco install mingw -f -y
pip install --force cibuildwheel==2.3.1
go get -d
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
if: runner.os == 'Linux'
- name: Build Linux wheels and sdist
if: runner.os == 'Linux'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-musllinux_i686 *-musllinux_aarch64 *-musllinux_ppc64le *-musllinux_s390x *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python setup.py sdist
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build i686 wheel
if: runner.os == 'Linux'
env:
CIBW_ARCHS_LINUX: i686
CIBW_BUILD_VERBOSITY: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build ARM64 wheel
if: runner.os == 'Linux'
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD_VERBOSITY: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build x86_64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: x86_64
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build arm64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: arm64
GOARCH: arm64
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build Windows wheels
if: runner.os == 'Windows'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Publish sdist
if: runner.os == 'Linux'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine check ./dist/*.tar.gz
twine upload --skip-existing ./dist/*
- uses: actions/upload-artifact@v2
with:
path: |
./wheelhouse/*.whl
./dist/*.tar.gz
- name: Publish wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: ${{ github.event_name == 'release' && env.TWINE_USERNAME != null }}
run: |
twine check ./wheelhouse/*.whl
twine upload --skip-existing ./wheelhouse/*