-
Notifications
You must be signed in to change notification settings - Fork 38
100 lines (87 loc) · 2.72 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
arch: [auto64]
include:
# - os: ubuntu-20.04
# arch: aarch64
- os: macos-10.15
arch: arm64
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.arch != 'auto64'
uses: docker/setup-qemu-action@v1
with:
platforms: ${{ matrix.arch }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.1.1
env:
CIBW_BUILD: cp*
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_MACOS: TARGET_ARCH=${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_ALL: bash scripts/build_${{ runner.os }}.sh
CIBW_BEFORE_BUILD: pip install pybind11 numpy
CIBW_TEST_REQUIRES: pytest pillow glfw
CIBW_TEST_REQUIRES_MACOS: pytest pillow pyopengl
CIBW_TEST_COMMAND: python -m pytest {project}/tests
CIBW_TEST_COMMAND_LINUX: >
xvfb-run -s "-screen 0 640x480x24" python -m pytest {project}/tests
CIBW_TEST_SKIP: "*-macosx_arm64"
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_docs:
name: Build docs
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Build docs
run: |
python -m pip install -f dist skia-python
python -m pip install sphinx sphinx-rtd-theme
python setup.py build_sphinx
- name: Deploy docs
if: github.event_name == 'release' && github.event.action == 'published'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
publish:
name: Upload packages to PyPI
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}