-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (82 loc) · 2.8 KB
/
test-and-deploy.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
name: Build, test, and deploy to PyPI
on:
push:
pull_request:
schedule:
# run weekly on a Monday
- cron: '0 0 * * 1'
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
jobs:
make_wheels:
strategy:
matrix:
include:
- config: {"name": "Linux", "os": "ubuntu-20.04", "arch": "x86_64"}
- config: {"name": "Linux", "os": "ubuntu-20.04", "arch": "aarch64"}
- config: {"name": "macOS", "os": "macos-11", "arch": "x86_64"}
- config: {"name": "Windows", "os": "windows-2022", "arch": "AMD64"}
name: Make wheels for ${{ matrix.config.os }} ${{ matrix.config.arch }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Build wheels
if: matrix.config.name == 'Linux'
uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_ARCHS_LINUX: ${{ matrix.config.arch }}
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_TEST_COMMAND: "bash {project}/ci/test"
CIBW_BEFORE_BUILD: "python -m pip install cffi cmake --upgrade && python build_ext.py"
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels
if: matrix.config.name == 'Windows'
uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_TEST_COMMAND: "bash {project}/ci/test"
CIBW_BEFORE_BUILD: "python -m pip install cffi cmake --upgrade && python build_ext.py"
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels
if: matrix.config.name == 'macOS'
uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_ARCHS_MACOS: ${{ matrix.config.arch }}
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_TEST_COMMAND: "bash {project}/ci/test"
CIBW_BEFORE_BUILD: "python -m pip install cffi cmake --upgrade && python build_ext.py"
CIBW_BUILD_VERBOSITY: 1
SYSTEM_VERSION_COMPAT: 0
- uses: actions/upload-artifact@v3
with:
name: artifact
path: wheelhouse/*.whl
make_sdist:
name: Make sdist
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
name: artifact
path: dist/*.tar.gz
upload_all:
needs: [make_wheels, make_sdist]
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.pypi_password }}