-
Notifications
You must be signed in to change notification settings - Fork 0
254 lines (218 loc) · 8.61 KB
/
Copy pathbuild.yml
File metadata and controls
254 lines (218 loc) · 8.61 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
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
name: build
on:
push:
branches: [master, main]
tags: ['v*']
pull_request:
workflow_dispatch:
jobs:
linux:
name: Linux (Ubuntu)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
meson ninja-build pkg-config build-essential \
libvlccore-dev libvlc-dev
- name: Configure
run: meson setup build --buildtype=release
- name: Compile
run: meson compile -C build
- name: Show artefact
run: ls -la build/libu64stream_plugin.so
- name: Install VLC for smoke test
run: |
sudo apt-get install -y vlc
- name: Runtime smoke test (synthetic sender → VLC)
run: |
set -e
# Start the synthetic U64 sender on loopback.
python3 tools/u64_test_sender.py --host 127.0.0.1 --port 11000 \
> /tmp/sender.log 2>&1 &
SENDER_PID=$!
# Give it a moment to start emitting.
sleep 0.5
# Run VLC headless against the loopback stream for ~3 s.
set +e
VLC_PLUGIN_PATH="$PWD/build" timeout 8s vlc -vv \
--intf dummy --vout dummy --aout dummy \
--no-video-title-show --run-time=3 \
'u64://@:11000?source=127.0.0.1' \
> /tmp/vlc.log 2>&1
set -e
kill $SENDER_PID 2>/dev/null || true
wait 2>/dev/null || true
echo "=== relevant VLC log lines ==="
grep -iE \
"u64stream|using .*decoder module|video output|Received first picture|Could not convert|playback too late|PCR called too late" \
/tmp/vlc.log | grep -ivE "configure" | head -30 || true
# Assertions
grep -q "U64 PAL: video 384x272 @ 50Hz" /tmp/vlc.log \
|| { echo "FAIL: format announcement missing"; exit 1; }
grep -q 'using access_demux module "u64stream"' /tmp/vlc.log \
|| { echo "FAIL: demux not selected"; exit 1; }
grep -q 'using video decoder module' /tmp/vlc.log \
|| { echo "FAIL: video decoder did not engage"; exit 1; }
grep -q 'using audio decoder module' /tmp/vlc.log \
|| { echo "FAIL: audio decoder did not engage"; exit 1; }
if grep -q "Could not convert timestamp" /tmp/vlc.log; then
echo "FAIL: timestamp conversion errors observed"; exit 1
fi
echo "smoke test passed"
- uses: actions/upload-artifact@v4
with:
name: u64stream-linux-x86_64
path: build/libu64stream_plugin.so
if-no-files-found: error
windows:
name: Windows (MSYS2 / MinGW64)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- name: Set up MSYS2 + MinGW64
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-meson
mingw-w64-x86_64-ninja
mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-vlc
- name: Sanity-check VLC SDK
run: |
pkg-config --modversion vlc-plugin || true
pkg-config --cflags vlc-plugin || true
- name: Configure
run: meson setup build --buildtype=release
- name: Compile
run: meson compile -C build
- name: Show artefact
run: ls -la build/libu64stream_plugin.dll || ls -la build/u64stream_plugin.dll || ls -la build/
- uses: actions/upload-artifact@v4
with:
name: u64stream-windows-x86_64
path: |
build/*.dll
build/*plugin*
if-no-files-found: error
macos:
name: macOS (Apple Silicon)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: brew install meson ninja pkg-config
- name: Install VLC, fetch plugin SDK headers, synthesise vlc-plugin.pc
run: |
set -euo pipefail
brew install --cask vlc
VLC_APP="/Applications/VLC.app/Contents/MacOS"
ls -la "$VLC_APP"
# The cask only ships the public libvlc API headers under
# include/vlc/ — there's no include/vlc/plugins/ with the plugin
# SDK. Download the matching source tarball and extract the
# internal plugin headers (top-level include/vlc_*.h in the
# source tree map to <vlc/plugins/*.h> when installed).
VLC_VERSION="$(/Applications/VLC.app/Contents/MacOS/VLC --version 2>/dev/null | head -1 | awk '{print $3}')"
: "${VLC_VERSION:=3.0.23}"
echo "Detected VLC version: $VLC_VERSION"
SRC_URL="https://download.videolan.org/pub/videolan/vlc/${VLC_VERSION}/vlc-${VLC_VERSION}.tar.xz"
cd "$RUNNER_TEMP"
curl -fL -o vlc-src.tar.xz "$SRC_URL"
tar -xf vlc-src.tar.xz
SRCDIR="$RUNNER_TEMP/vlc-${VLC_VERSION}"
# Lay out the SDK headers in $RUNNER_TEMP/sdk-include with the
# standard install layout: vlc/plugins/vlc_*.h
SDK_INC="$RUNNER_TEMP/sdk-include"
mkdir -p "$SDK_INC/vlc/plugins"
# Public libvlc API (already in VLC.app, but keep things together).
cp -R "$SRCDIR/include/vlc/." "$SDK_INC/vlc/" 2>/dev/null || true
# Plugin SDK: top-level vlc_*.h in source -> vlc/plugins/ here.
cp "$SRCDIR/include/"vlc_*.h "$SDK_INC/vlc/plugins/"
ls "$SDK_INC/vlc/plugins/" | head -20
# Synthesise vlc-plugin.pc pointing at the extracted headers
# and the libvlccore .dylib inside the .app.
PCDIR="$RUNNER_TEMP/pkgconfig"
mkdir -p "$PCDIR"
cat > "$PCDIR/vlc-plugin.pc" <<EOF
prefix=$VLC_APP
sdk_includedir=$SDK_INC
libdir=\${prefix}/lib
Name: vlc-plugin
Description: VLC plugin SDK
Version: ${VLC_VERSION}
Cflags: -I\${sdk_includedir}/vlc/plugins -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE
Libs: -L\${libdir} -lvlccore
EOF
echo "PKG_CONFIG_PATH=$PCDIR" >> "$GITHUB_ENV"
cat "$PCDIR/vlc-plugin.pc"
# The .dylib in VLC.app/Contents/MacOS/lib has unstable names;
# if linking fails we'll need an explicit -L. For now point at
# the install prefix and let the linker find libvlccore.dylib.
ls "$VLC_APP/lib" | head -20
- name: Configure
run: meson setup build --buildtype=release
- name: Compile
run: meson compile -C build
- name: Show artefact
run: ls -la build/
- uses: actions/upload-artifact@v4
with:
name: u64stream-macos
path: build/*.dylib
if-no-files-found: error
# On v* tag push: gather the three platform artefacts, rename them with
# the tag version, and publish (or update) the corresponding GitHub
# Release. Idempotent — re-running the workflow on the same tag updates
# assets in place.
release:
name: Release
needs: [linux, windows, macos]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Stage release files
run: |
set -euo pipefail
TAG="${GITHUB_REF#refs/tags/}"
mkdir -p release
cp artifacts/u64stream-linux-x86_64/libu64stream_plugin.so \
"release/libu64stream_plugin-${TAG}-linux-x86_64.so"
cp artifacts/u64stream-windows-x86_64/libu64stream_plugin.dll \
"release/libu64stream_plugin-${TAG}-windows-x86_64.dll"
cp artifacts/u64stream-macos/libu64stream_plugin.dylib \
"release/libu64stream_plugin-${TAG}-macos-arm64.dylib"
ls -la release/
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
TAG="${GITHUB_REF#refs/tags/}"
if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" \
> /dev/null 2>&1; then
echo "Release $TAG exists; uploading/updating assets."
gh release upload "$TAG" release/* \
--repo "$GITHUB_REPOSITORY" --clobber
else
echo "Creating release $TAG."
gh release create "$TAG" \
--repo "$GITHUB_REPOSITORY" \
--title "$TAG" \
--generate-notes \
release/*
fi