-
-
Notifications
You must be signed in to change notification settings - Fork 11
97 lines (88 loc) · 2.68 KB
/
build.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 And Publish
on:
push:
branches: [ master ]
paths:
- '.github/workflows/*'
- 'cmake/*'
- 'deps/*'
- 'include/*'
- 'ntgcalls/*'
- 'wrtc/*'
- 'CMakeLists.txt'
- 'setup.py'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_archs: "native"
shared_name: "linux-x86_64"
cibw_os_build: "manylinux_"
#- os: ubuntu-latest
# cibw_archs: "aarch64"
# shared_name: "linux-arm64"
# cibw_os_build: "manylinux_"
- os: windows-latest
cibw_archs: "native"
shared_name: "windows-x86_64"
- os: macos-13
cibw_archs: "arm64"
cibw_os_build: "macosx_arm64"
shared_name: "macos-arm64"
fail-fast: false
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up QEMU
if: matrix.cibw_archs == 'aarch64'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build Shared Libs
run: python3 setup.py build_shared --no-preserve-cache
- name: Upload shared libs for ${{ matrix.shared_name }}
uses: actions/upload-artifact@v3
with:
name: ntgcalls-${{ matrix.shared_name }}-lib.zip
path: ./shared-output/*
if-no-files-found: error
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD: cp3*-${{ matrix.cibw_os_build }}*
CIBW_SKIP: cp36-*
CIBW_BUILD_VERBOSITY: 3
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_TEST_COMMAND: python -c "from ntgcalls import NTgCalls; NTgCalls().ping()"
- uses: actions/upload-artifact@v3
with:
name: ntgcalls-${{ matrix.shared_name }}-wheels.zip
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs: [build]
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: tmp/
- name: Extract artifacts
run: |
mkdir dist
find tmp -type f -name "*.whl" | xargs -I {} mv {} dist
- name: Publish a Python distribution to PyPI.
if: github.ref == 'refs/heads/master' && github.repository == 'pytgcalls/ntgcalls'
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: dist/