forked from CESNET/UltraGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
354 lines (340 loc) · 15 KB
/
ccpp.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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
name: C/C++ CI
on:
pull_request:
push:
branches:
- master
tags:
- v[0-9]+.*
paths:
- '.github/scripts/**'
- '.github/workflows/ccpp.yml'
- '**.c'
- '**.cpp'
- '**.cu'
- '**.h'
- '**.hpp'
- '**.m'
- '**.mm'
- 'autogen.sh'
- 'configure.ac'
- 'data/**'
- 'Makefile.in'
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, we do not need to create own token.
steps:
- uses: actions/checkout@v4
id: checkout
with:
persist-credentials: true
- name: Init environment variables
run: . .github/scripts/environment.sh
- name: Retag continuous
if: github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master'
run: |
git fetch --prune --unshallow --tags
git tag -f $TAG
git push -f origin refs/tags/$TAG:refs/tags/$TAG
- name: Update Release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: .github/scripts/create_release.sh
- name: Create continuous release # ensure continuous release is present for AppImage zsync
if: startsWith(github.ref, 'refs/tags/')
run: .github/scripts/create_continuous_release.sh
Ubuntu:
name: run Ubuntu
needs: prepare
runs-on: ubuntu-20.04
env:
appimage_key: ${{ secrets.appimage_key }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v4
- name: Fetch SDKs ETags
id: etags
run: |
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.tar.gz)" >> $GITHUB_OUTPUT
- name: Cache NDI
id: cache-ndi
uses: actions/cache@main
with:
path: /var/tmp/Install_NDI_SDK_Linux.tar.gz
key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }}
- name: Download NDI
if: steps.cache-ndi.outputs.cache-hit != 'true'
run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz
- name: bootstrap
run: |
. .github/scripts/environment.sh
.github/scripts/Linux/prepare.sh
- name: Cache FFmpeg
id: cache-ffmpeg
uses: actions/cache@main
with:
path: '/var/tmp/ffmpeg'
key: cache-ffmpeg-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/prepare.sh', '.github/scripts/Linux/download_build_ffmpeg.sh', '.github/scripts/Linux/ffmpeg-patches/*') }}
- name: Build FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: .github/scripts/Linux/download_build_ffmpeg.sh
- name: Install Cached FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit == 'true'
run: .github/scripts/Linux/install_ffmpeg.sh
- name: configure
run: "./autogen.sh $FEATURES || { RC=$?; cat config.log; exit $RC; }"
- name: make
run: make -j4
- name: make check
run: make check
- name: make distcheck
run: make distcheck
- name: check libc/libstdc++ ABI
run: .github/scripts/Linux/check_abi.sh 2.31 3.4.28 1.3.12 bin/* lib/ultragrid/*
- name: Create AppImage
run: data/scripts/Linux-AppImage/create-appimage.sh https://github.com/$GITHUB_REPOSITORY/releases/download/continuous/UltraGrid-$CHANNEL-x86_64.AppImage.zsync
- name: Check AppImage
run: |
mkdir aitest-context # empty build context
docker build -f .github/scripts/Linux/utils/Dockerfile.ubuntu -t aitest-ubuntu aitest-context
docker build -f .github/scripts/Linux/utils/Dockerfile.arch -t aitest-arch aitest-context
curl -LS -O https://raw.githubusercontent.com/AppImage/pkg2appimage/master/appdir-lint.sh -O https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist
sudo apt install desktop-file-utils libfile-mimeinfo-perl # desktop-file-validate, mimetype
./UltraGrid-$VERSION-x86_64.AppImage --appimage-extract
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu /AppImage/AppRun -v
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu /AppImage/AppRun --tool uv-qt -h
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu sh -c 'xvfb-run /AppImage/AppRun --tool uv-qt & { sleep 10; kill $!; }'
docker run --rm -v $PWD/squashfs-root/:/AppImage aitest-ubuntu /AppImage/AppRun --list-modules
docker run --rm -v $PWD/squashfs-root:/AppImage aitest-arch /AppImage/AppRun --capabilities
bash appdir-lint.sh squashfs-root
- name: Upload Release Asset
id: upload-release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: |
sudo apt install jq zsync
zsyncmake -C -u https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/UltraGrid-$VERSION-x86_64.AppImage -o UltraGrid-$CHANNEL-x86_64.AppImage.zsync UltraGrid-$VERSION-x86_64.AppImage
.github/scripts/replace-asset.sh continuous UltraGrid-$CHANNEL-x86_64.AppImage.zsync application/x-zsync AppImage%20${CHANNEL}%20zsync
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION-x86_64.AppImage application/x-appimage Linux%20build
- name: Upload Build
if: steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@main
with:
name: UltraGrid-Linux
path: UltraGrid-${{ env.VERSION }}-x86_64.AppImage
macOS:
name: run macOS
needs: prepare
strategy:
matrix:
os: [macos-13, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SDK_NONFREE_PATH: /private/var/tmp/sdks-nonfree
notarytool_credentials: ${{ secrets.notarytool_credentials }}
apple_key_p12_b64: ${{ secrets.apple_key_p12_b64 }}
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v4
- name: Fetch SDKs ETags
id: etags
run: |
echo "nonfree=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh "$SDK_URL/$DELTA_MAC_ARCHIVE")" >> $GITHUB_OUTPUT
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v6_Apple.pkg)" >> $GITHUB_OUTPUT
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://www.ximea.com/downloads/recent/XIMEA_OSX_SP.dmg)" >> $GITHUB_OUTPUT
- name: Set environment
run: . .github/scripts/environment.sh
- name: Cache Non-Free SDKs
id: cache-macos-nonfree-sdks
uses: actions/cache@main
with:
path: ${{ env.SDK_NONFREE_PATH }}
key: cache-nonfree-sdks-${{ runner.os }}-${{ steps.etags.outputs.nonfree }}
- name: Download Non-Free SDKs
if: steps.cache-macos-nonfree-sdks.outputs.cache-hit != 'true' && env.SDK_URL != null
run: |
rm -rf ${{ env.SDK_NONFREE_PATH }}
mkdir -p ${{ env.SDK_NONFREE_PATH }}
cd ${{ env.SDK_NONFREE_PATH }}
curl -S -f -O "$SDK_URL/$DELTA_MAC_ARCHIVE" || true
- name: Cache XIMEA
id: cache-macos-ximea
uses: actions/cache@main
with:
path: /var/tmp/XIMEA_OSX_SP.dmg
key: cache-ximea-${{ runner.os }}-${{ steps.etags.outputs.ximea }}
- name: Download XIMEA
if: steps.cache-macos-ximea.outputs.cache-hit != 'true'
run: curl -S -L https://www.ximea.com/downloads/recent/XIMEA_OSX_SP.dmg -o /private/var/tmp/XIMEA_OSX_SP.dmg
- name: Cache NDI
id: cache-ndi
uses: actions/cache@main
with:
path: /private/var/tmp/Install_NDI_SDK_Apple.pkg
key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }}
- name: Download NDI
if: steps.cache-ndi.outputs.cache-hit != 'true'
run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v6_Apple.pkg -o /private/var/tmp/Install_NDI_SDK_Apple.pkg
- name: bootstrap
run: .github/scripts/macOS/prepare.sh
- name: configure
run: "ARCH=$UG_ARCH ./autogen.sh $FEATURES || { RC=$?; cat config.log; exit $RC; }"
- name: make bundle
run: make -j4 gui-bundle
- name: make check
run: make check
- name: make distcheck
run: |
for n in lib opt; do sudo mv /usr/local/$n /usr/local/$n-; done # hide local libs
sudo mv $(xcrun --show-sdk-path)/System/Library/Frameworks /tmp/FRMWK
make distcheck TARGET=uv-qt.app/Contents/MacOS/uv REFLECTOR_TARGET=uv-qt.app/Contents/MacOS/hd-rum-transcode GUI_EXE=uv-qt.app/Contents/MacOS/uv-qt
for n in lib opt; do sudo mv /usr/local/$n- /usr/local/$n; done # return back
sudo mv /tmp/FRMWK $(xcrun --show-sdk-path)/System/Library/Frameworks
- name: sign+notarize
if: env.KEY_CHAIN != null
run: .github/scripts/macOS/sign.sh uv-qt.app
- name: make dmg
run: |
for n in `seq 5`; do # do more attempts
if make osx-gui-dmg; then break; fi
if [ $n -eq 5 ]; then false; fi
sleep $((n * 10))
done
mv UltraGrid.dmg UltraGrid-$VERSION.dmg
- name: Upload Release Asset
id: upload-release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: |
brew list jq 2>/dev/null || brew install jq
.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION.dmg application/x-apple-diskimage macOS%20$(uname -m)%20build
- name: Upload Build
if: steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@main
with:
name: UltraGrid-${{ env.VERSION }}-macOS
path: UltraGrid-${{ env.VERSION }}.dmg
Windows:
name: run Windows
needs: prepare
runs-on: windows-latest
defaults:
run:
shell: C:\shells\msys2bash.cmd {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSYS2_PATH_TYPE: inherit
SDK_URL: ${{ secrets.SDK_URL }}
steps:
- uses: actions/checkout@v4
- name: Fetch SDKs ETags
id: etags
run: |
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK/NDI%206%20SDK.exe)" >> $GITHUB_OUTPUT
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://www.ximea.com/support/attachments/download/37/XIMEA_API_Installer.exe)" >> $GITHUB_OUTPUT
- name: Set environment
run: .github/scripts/environment.sh
- name: Find MSVC
run: .github/scripts/Windows/find_msvc.ps1
shell: pwsh -command ". '{0}'"
- name: Cache NDI
id: cache-ndi
uses: actions/cache@main
with:
path: 'C:\ndi.exe'
key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }}
- name: Download NDI
if: steps.cache-ndi.outputs.cache-hit != 'true'
run: curl 'https://downloads.ndi.tv/SDK/NDI_SDK/NDI%206%20SDK.exe' -o 'C:\ndi.exe'
- name: Cache XIMEA
id: cache-macos-ximea
uses: actions/cache@main
with:
path: 'C:\XIMEA_API_Installer.exe'
key: cache-ximea-${{ runner.os }}-${{ steps.etags.outputs.ximea }}
- name: Download XIMEA
if: steps.cache-macos-ximea.outputs.cache-hit != 'true'
run: curl 'https://www.ximea.com/support/attachments/download/37/XIMEA_API_Installer.exe' -o 'C:\XIMEA_API_Installer.exe'
- name: Cache libajantv2 build
id: cache-aja
uses: actions/cache@main
with:
path: 'libajantv2'
key: cache-aja-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }}
- name: Cache live555
id: cache-live555
uses: actions/cache@main
with:
path: 'live555'
key: cache-live555-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }}
- name: bootsrap
run: .github/scripts/Windows/prepare.ps1
shell: pwsh -command ". '{0}'"
- name: Cache JACK
id: cache-jack
uses: actions/cache@main
with:
path: 'C:\Program Files\JACK2'
key: cache-jack-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/install_jack.ps1') }}
- name: Install JACK
if: steps.cache-jack.outputs.cache-hit != 'true'
run: .github/scripts/Windows/install_jack.ps1
shell: pwsh -command ". '{0}'"
- name: bootsrap MSYS2
run: $GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh
- name: Cache Spout build
id: cache-spout
uses: actions/cache@main
with:
path: 'C:\Spout2'
key: cache-spout-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/install_spout.sh') }}
- name: Build Spout
if: steps.cache-spout.outputs.cache-hit != 'true'
run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_spout.sh build
- name: Install Spout
run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_spout.sh install
- name: Cache CineForm build
id: cache-cineform
uses: actions/cache@main
with:
path: 'C:\cineform-sdk'
key: cache-cineform-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/install_cineform.sh') }}
- name: Build CineForm
if: steps.cache-cineform.outputs.cache-hit != 'true'
run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_cineform.sh build
- name: Install CineForm
run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_cineform.sh install
- name: configure
run: ./autogen.sh --prefix=/ --bindir=/ --docdir=/doc $FEATURES || { RC=$?; cat config.log; exit $RC; }
- name: make
run: make -j4
- name: make check
run: make check
- name: make bundle
run: |
cp gui/QT/uv-qt.exe bin
rm bin/run_tests.exe
export DESTDIR=build/UltraGrid-$VERSION-win64
make install
for exe in "$DESTDIR"/*exe; do data/scripts/get_dll_depends.sh "$exe" | while read -r n; do cp "$n" "$DESTDIR"; done; done
if command -v windeployqt-qt6 >/dev/null; then windeployqt-qt6 "$DESTDIR/uv-qt.exe"; else windeployqt "$DESTDIR/uv-qt.exe"; fi
cp -r data/Windows/* "$DESTDIR"
data/scripts/get_dll_depends.sh "$DESTDIR/screen-capture-recorder-x64.dll" | while read -r n; do cp "$n" "$DESTDIR"; done
- name: make dist-check
run: PATH= /usr/bin/make distcheck TARGET=build/UltraGrid-$VERSION-win64/uv.exe REFLECTOR_TARGET=build/UltraGrid-$VERSION-win64/hd-rum-transcode.exe GUI_EXE=build/UltraGrid-$VERSION-win64/uv-qt.exe
- name: Upload Release Asset
id: upload-release
if: (github.repository == 'CESNET/UltraGrid' && github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/')
run: |
cd build; zip -9 -r UltraGrid-$VERSION-win64.zip UltraGrid-$VERSION-win64
$GITHUB_WORKSPACE/.github/scripts/replace-asset.sh $TAG UltraGrid-$VERSION-win64.zip application/zip Windows%20build
- name: Upload Build
if: steps.upload-release.conclusion == 'skipped'
uses: actions/upload-artifact@main
with:
name: UltraGrid-Windows
path: build
# vi: set expandtab sw=2: