-
-
Notifications
You must be signed in to change notification settings - Fork 10
99 lines (87 loc) · 2.98 KB
/
build_windows_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
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build and publish Windows wheels
on:
push:
branches:
- pypi-dev
paths:
- '.github/workflows/build_windows_wheels.yml'
- 'python-webrtc/cpp/**'
- 'CMakeLists.txt'
- 'setup.py'
jobs:
# Disk C is used to bypass limitation of default disk space
# ref: https://github.com/actions/virtual-environments/issues/1341
build_wheels_for_windows:
name: Build and publish wheels for Windows
runs-on: windows-2019
strategy:
matrix:
arch: [
# "x32",
"x64",
]
env:
WEBRTC_CACHE_KEY: "1"
steps:
- name: Clone.
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment.
shell: bash
run: |
echo "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\" >> $GITHUB_PATH
git config --global core.longpaths true
- name: Move repository to disk C.
run: |
xcopy . C:\src\ /E/H
- name: WebRTC cache.
uses: actions/cache@v2
with:
path: "C:/src/third_party/libwebrtc"
key: ${{ runner.os }}-${{ matrix.arch }}-cache-webrtc-${{ env.WEBRTC_CACHE_KEY }}
- name: Build wheels for x32.
if: matrix.arch == 'x32'
working-directory: "C:/src"
env:
DEPOT_TOOLS_UPDATE: 0
TARGET_ARCH: ia32
CIBW_BEFORE_BUILD: call vcvars32.bat
CIBW_ARCHS: x86
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD: cp3*-*
CIBW_SKIP: cp36-*
# because after each build there is some strange local changes and the next build can't check out
CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q
CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()"
run: |
pip install cibuildwheel==2.3.1
cibuildwheel
- name: Build wheels for x64.
if: matrix.arch == 'x64'
working-directory: "C:/src"
env:
DEPOT_TOOLS_UPDATE: 0
CIBW_ARCHS: AMD64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD: cp3*-*
CIBW_SKIP: cp36-*
# because after each build there is some strange local changes and the next build can't check out
CIBW_BEFORE_TEST: rmdir C:\src\third_party\depot_tools /s /q
CIBW_TEST_COMMAND: python -c "import wrtc; wrtc.ping()"
run: |
pip install cibuildwheel==2.3.1
cibuildwheel
- name: Upload artifacts.
uses: actions/upload-artifact@v2
with:
name: "wrtc wheels for Windows"
path: "C:/src/wheelhouse/*.whl"
- 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 C:/src/wheelhouse/*