-
-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (69 loc) · 2.1 KB
/
build_macos_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
name: Build and publish macOS wheels
on:
push:
branches:
- pypi-dev
paths:
- '.github/workflows/build_macos_wheels.yml'
- 'python-webrtc/cpp/**'
- 'CMakeLists.txt'
- 'setup.py'
jobs:
build_wheels_for_macos:
name: Build and publish wheels for macOS
runs-on: macos-12
strategy:
matrix:
arch: [
"Intel",
"M1",
]
env:
WEBRTC_CACHE_KEY: "2"
steps:
- name: Clone.
uses: actions/checkout@v2
with:
submodules: recursive
- name: WebRTC cache.
uses: actions/cache@v2
with:
path: third_party/libwebrtc
key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }}
- name: Build wheels (Intel).
if: matrix.arch == 'Intel'
uses: pypa/[email protected]
env:
DEPOT_TOOLS_UPDATE: 0
DEPOT_TOOLS_METRICS: 0
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD: cp3*-*
CIBW_SKIP: cp36-*
CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()"
- name: Build wheels (M1).
if: matrix.arch == 'M1'
uses: pypa/[email protected]
env:
TARGET_ARCH: arm64
DEPOT_TOOLS_UPDATE: 0
DEPOT_TOOLS_METRICS: 0
CIBW_ARCHS: arm64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD: cp3*-*
- name: Upload artifacts (${{ matrix.arch }}).
uses: actions/upload-artifact@v2
with:
name: wrtc for macOS (${{ matrix.arch }})
path: ./wheelhouse/*.whl
- uses: actions/setup-python@v2
if: github.ref == 'refs/heads/pypi-dev' && github.repository == 'MarshalX/python-webrtc'
with:
python-version: 3.7
- name: Publish a Python distribution to PyPI.
if: github.ref == 'refs/heads/pypi-dev' && github.repository == 'MarshalX/python-webrtc'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install twine
twine upload wheelhouse/*