-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (67 loc) · 2.11 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
name: Build
on: [push, pull_request]
defaults:
run:
shell: bash --noprofile --norc -xeo pipefail {0}
jobs:
build_wheel:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install -U cibuildwheel
- name: Build wheels
env:
CIBW_BUILD: "cp3?-* cp31?-*"
CIBW_SKIP: "*-manylinux_i686 *-win32"
CIBW_BUILD_VERBOSITY: "1"
CIBW_ENVIRONMENT_LINUX: "CFLAGS=-g0 LDFLAGS=-Wl,-strip-debug"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_BEFORE_TEST: "pip install pytest"
CIBW_TEST_COMMAND: "pytest {project}/test"
run: python -m cibuildwheel --output-dir wheelhouse
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Wheels (${{ runner.os }})
path: wheelhouse/*
release:
name: Release
runs-on: ubuntu-latest
needs: [build_wheel]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install -U setuptools twine
- name: Build source distribution
run: python setup.py sdist
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: wheelhouse
- name: Publish PyPI release
env:
TWINE_NON_INTERACTIVE: 1
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# Optional: twine will fallback to default if empty.
TWINE_REPOSITORY_URL: ${{ secrets.PYPI_URL }}
run: python -m twine upload dist/* wheelhouse/*/*