-
Notifications
You must be signed in to change notification settings - Fork 41
105 lines (89 loc) · 3.33 KB
/
build.yml
File metadata and controls
105 lines (89 loc) · 3.33 KB
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
101
102
103
104
105
name: Build
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NDI_SDK_VERSION: "6.3.2.0"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v4
with:
platforms: arm64,arm
# Linux: run installer (EULA via echo y), rename to ndi-sdk/
# Accessible in Docker container at /project/ndi-sdk
- name: Cache NDI SDK (Linux)
if: runner.os == 'Linux'
id: cache-ndi-linux
uses: actions/cache@v5
with:
path: ndi-sdk
key: ndi-sdk-linux-${{ env.NDI_SDK_VERSION }}
- name: Download and install NDI SDK (Linux)
if: runner.os == 'Linux' && steps.cache-ndi-linux.outputs.cache-hit != 'true'
run: |
curl -fsSL "${{ secrets.NDI_SDK_URL_LINUX }}" -o ndi-sdk-installer.tar.gz
tar -xzf ndi-sdk-installer.tar.gz
echo y | sh Install_NDI_SDK_v6_Linux.sh
mv "NDI SDK for Linux" ndi-sdk
rm ndi-sdk-installer.tar.gz Install_NDI_SDK_v6_Linux.sh
# macOS: cache installer, always install (fast)
- name: Cache NDI SDK (macOS)
if: runner.os == 'macOS'
id: cache-ndi-macos
uses: actions/cache@v5
with:
path: ndi-sdk.pkg
key: ndi-sdk-macos-${{ env.NDI_SDK_VERSION }}
- name: Download NDI SDK (macOS)
if: runner.os == 'macOS' && steps.cache-ndi-macos.outputs.cache-hit != 'true'
run: curl -fsSL "${{ secrets.NDI_SDK_URL_MACOS }}" -o ndi-sdk.pkg
- name: Install NDI SDK (macOS)
if: runner.os == 'macOS'
run: sudo installer -pkg ndi-sdk.pkg -target /
# Windows: extract with innoextract (no installer needed)
- name: Cache NDI SDK (Windows)
if: runner.os == 'Windows'
id: cache-ndi-windows
uses: actions/cache@v5
with:
path: ndi-sdk-win
key: ndi-sdk-windows-${{ env.NDI_SDK_VERSION }}
- name: Install innoextract (Windows)
if: runner.os == 'Windows' && steps.cache-ndi-windows.outputs.cache-hit != 'true'
uses: MinoruSekine/setup-scoop@v4
with:
apps: innoextract
- name: Download and extract NDI SDK (Windows)
if: runner.os == 'Windows' && steps.cache-ndi-windows.outputs.cache-hit != 'true'
shell: pwsh
run: |
Invoke-WebRequest -Uri "${{ secrets.NDI_SDK_URL_WINDOWS }}" -OutFile ndi-sdk.exe
innoextract ndi-sdk.exe --output-dir ndi-sdk-win
Remove-Item ndi-sdk.exe
- name: Set NDI_SDK_DIR (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$path = "${{ github.workspace }}" -replace '\\', '/'
echo "NDI_SDK_DIR=$path/ndi-sdk-win/app" >> $env:GITHUB_ENV
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
env:
CIBW_BUILD: "cp310-* cp314-*"
CIBW_ENVIRONMENT_LINUX: CMAKE_ARGS="-DNDI_SDK_DIR=/project/ndi-sdk"
CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DNDI_SDK_DIR=${{ env.NDI_SDK_DIR }}"