-
Notifications
You must be signed in to change notification settings - Fork 41
138 lines (116 loc) · 3.88 KB
/
release.yml
File metadata and controls
138 lines (116 loc) · 3.88 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Release
on:
push:
tags: ["v*"]
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
- 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
- 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 /
- 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_ENVIRONMENT_LINUX: CMAKE_ARGS="-DNDI_SDK_DIR=/project/ndi-sdk"
CIBW_ENVIRONMENT_WINDOWS: CMAKE_ARGS="-DNDI_SDK_DIR=${{ env.NDI_SDK_DIR }}"
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
release:
name: Create GitHub Release
needs: build_wheels
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheels-*
path: wheelhouse
merge-multiple: true
- uses: softprops/action-gh-release@v3
with:
files: wheelhouse/*.whl
publish:
name: Publish to PyPI
needs: release
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/ndi-python/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheels-*
path: wheelhouse
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/