@@ -2,25 +2,31 @@ name: Ubuntu Linux (x86_64)
22
33on :
44 push :
5- branches :
6- - " *"
7- tags :
8- - " *"
9-
5+ branches :
6+ - " *"
7+ tags :
8+ - " *"
9+
1010 pull_request :
11- branches :
12- - " *"
11+ branches :
12+ - " *"
13+
14+ env :
15+ # ── ProjectM source configuration ──────────────────────────────────
16+ # Set to a tag (e.g. v4.1.4), branch name, or commit SHA.
17+ PROJECTM_REF : master
1318
1419jobs :
1520 build-projectm :
1621 name : Build ProjectM
1722 runs-on : ubuntu-latest
18-
23+
1924 steps :
2025 - name : Checkout ProjectM
2126 uses : actions/checkout@v4
2227 with :
2328 repository : ' projectM-visualizer/projectm'
29+ ref : ${{ env.PROJECTM_REF }}
2430 submodules : ' recursive'
2531
2632 - name : Get ProjectM Git Hash
@@ -53,12 +59,12 @@ jobs:
5359 run : |
5460 cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target install
5561 if : steps.cache-install.outputs.cache-hit != 'true'
56-
62+
5763 - name : Upload Artifact
5864 uses : actions/upload-artifact@v4
5965 with :
60- name : projectm-linux-shared-latest
61- path : install/*
66+ name : projectm-linux-shared-latest
67+ path : install/*
6268
6369 build-plugin :
6470 name : Build GST Plugin ProjectM
@@ -103,5 +109,332 @@ jobs:
103109 - name : Upload Artifact
104110 uses : actions/upload-artifact@v4
105111 with :
106- name : gst-projectm-linux-latest
107- path : ${{ github.workspace }}/cmake-build/libgstprojectm.so
112+ name : gst-projectm-linux-latest
113+ path : ${{ github.workspace }}/cmake-build/libgstprojectm.so
114+
115+ package-deb :
116+ name : Package DEB (Ubuntu 24.04)
117+ runs-on : ubuntu-24.04
118+ if : startsWith(github.ref, 'refs/tags/')
119+
120+ steps :
121+ - uses : actions/checkout@v4
122+
123+ - name : Wait for Plugin Build
124+ uses : yogeshlonkar/wait-for-jobs@v0
125+ with :
126+ interval : ' 5000'
127+ jobs : Build GST Plugin ProjectM
128+ ttl : ' 15'
129+
130+ - name : Download Plugin Artifact
131+ uses : actions/download-artifact@v4
132+ with :
133+ name : gst-projectm-linux-latest
134+ path : plugin
135+
136+ - name : Install packaging tools
137+ run : |
138+ sudo apt-get update
139+ sudo apt-get install -y dpkg-dev debhelper devscripts fakeroot
140+
141+ - name : Create DEB Package
142+ run : |
143+ VERSION="${GITHUB_REF_NAME#v}"
144+ ARCH=$(dpkg --print-architecture)
145+ MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
146+ PKG_NAME="gstreamer1.0-projectm"
147+ PKG_DIR="${PKG_NAME}_${VERSION}_${ARCH}"
148+
149+ mkdir -p "${PKG_DIR}/DEBIAN"
150+ mkdir -p "${PKG_DIR}/usr/lib/${MULTIARCH}/gstreamer-1.0"
151+
152+ # Copy the plugin only
153+ cp plugin/libgstprojectm.so "${PKG_DIR}/usr/lib/${MULTIARCH}/gstreamer-1.0/"
154+
155+ # Control file
156+ cat > "${PKG_DIR}/DEBIAN/control" << EOF
157+ Package: ${PKG_NAME}
158+ Version: ${VERSION}
159+ Section: libs
160+ Priority: optional
161+ Architecture: ${ARCH}
162+ Depends: gstreamer1.0-plugins-base (>= 1.20), libgstreamer-gl1.0-0 (>= 1.20), libgl1, libprojectm-dev (>= 4.1.0)
163+ Recommends: gstreamer1.0-plugins-good
164+ Maintainer: projectM Visualizer <[email protected] > 165+ Homepage: https://github.com/projectM-visualizer/gst-projectm
166+ Description: GStreamer plugin for projectM audio visualization
167+ This package provides a GStreamer plugin that uses the projectM library
168+ to render audio visualizations. It can be used with any GStreamer pipeline
169+ to add real-time music visualizations.
170+ .
171+ Requires projectM (libprojectM) to be installed separately.
172+ EOF
173+ sed -i 's/^ //' "${PKG_DIR}/DEBIAN/control"
174+
175+ # Set permissions
176+ find "${PKG_DIR}/usr" -type d -exec chmod 755 {} \;
177+ find "${PKG_DIR}/usr" -type f -name "*.so*" -exec chmod 644 {} \;
178+
179+ dpkg-deb --build "${PKG_DIR}"
180+
181+ - name : Upload DEB Package
182+ uses : actions/upload-artifact@v4
183+ with :
184+ name : release-deb-ubuntu2404
185+ path : " *.deb"
186+
187+ package-deb-src :
188+ name : Package DEB Source
189+ runs-on : ubuntu-24.04
190+ if : startsWith(github.ref, 'refs/tags/')
191+
192+ steps :
193+ - uses : actions/checkout@v4
194+
195+ - name : Install packaging tools
196+ run : |
197+ sudo apt-get update
198+ sudo apt-get install -y dpkg-dev debhelper devscripts fakeroot
199+
200+ - name : Create DEB Source Package
201+ run : |
202+ VERSION="${GITHUB_REF_NAME#v}"
203+ PKG_NAME="gstreamer1.0-projectm"
204+ SRC_DIR="${PKG_NAME}-${VERSION}"
205+
206+ mkdir -p "${SRC_DIR}"
207+ rsync -a --exclude=build --exclude=dist --exclude=.git \
208+ --exclude="*.deb" --exclude="${PKG_NAME}_*" --exclude="${PKG_NAME}-*" \
209+ . "${SRC_DIR}/"
210+
211+ mkdir -p "${SRC_DIR}/debian/source"
212+
213+ cat > "${SRC_DIR}/debian/changelog" << EOF
214+ ${PKG_NAME} (${VERSION}) noble; urgency=medium
215+
216+ * Release ${VERSION}
217+
218+ -- projectM Visualizer <[email protected] > $(date -R) 219+ EOF
220+
221+ cat > "${SRC_DIR}/debian/control" << EOF
222+ Source: ${PKG_NAME}
223+ Section: libs
224+ Priority: optional
225+ Maintainer: projectM Visualizer <[email protected] > 226+ Build-Depends: debhelper-compat (= 13), cmake (>= 3.21), ninja-build, pkg-config, libgl1-mesa-dev, mesa-common-dev, libgstreamer1.0-dev (>= 1.20), libgstreamer-plugins-base1.0-dev (>= 1.20), libprojectm-dev (>= 4.1.0)
227+ Standards-Version: 4.6.2
228+ Homepage: https://github.com/projectM-visualizer/gst-projectm
229+
230+ Package: ${PKG_NAME}
231+ Architecture: any
232+ Depends: \${shlibs:Depends}, \${misc:Depends}, gstreamer1.0-plugins-base (>= 1.20), libgstreamer-gl1.0-0 (>= 1.20), libprojectm-dev (>= 4.1.0)
233+ Description: GStreamer plugin for projectM audio visualization
234+ This package provides a GStreamer plugin that uses the projectM library
235+ to render audio visualizations. It can be used with any GStreamer pipeline
236+ to add real-time music visualizations.
237+ EOF
238+
239+ cat > "${SRC_DIR}/debian/rules" << 'RULESEOF'
240+ #!/usr/bin/make -f
241+ %:
242+ dh $@
243+
244+ override_dh_auto_configure:
245+ dh_auto_configure -- -G Ninja -DCMAKE_BUILD_TYPE=Release
246+ RULESEOF
247+ chmod +x "${SRC_DIR}/debian/rules"
248+
249+ echo "13" > "${SRC_DIR}/debian/compat"
250+
251+ cat > "${SRC_DIR}/debian/copyright" << EOF
252+ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
253+ Upstream-Name: gst-projectm
254+ Upstream-Contact: https://github.com/projectM-visualizer/gst-projectm
255+ Source: https://github.com/projectM-visualizer/gst-projectm
256+
257+ Files: *
258+ Copyright: projectM Visualizer contributors
259+ License: LGPL-2.1+
260+ EOF
261+
262+ echo "3.0 (native)" > "${SRC_DIR}/debian/source/format"
263+
264+ # Create orig tarball and source package
265+ tar czf "${PKG_NAME}_${VERSION}.orig.tar.gz" "${SRC_DIR}"
266+ cd "${SRC_DIR}"
267+ dpkg-source -b .
268+ cd ..
269+
270+ - name : Upload DEB Source Package
271+ uses : actions/upload-artifact@v4
272+ with :
273+ name : release-deb-source
274+ path : |
275+ gstreamer1.0-projectm_*.dsc
276+ gstreamer1.0-projectm_*.orig.tar.gz
277+ gstreamer1.0-projectm_*.debian.tar.*
278+
279+ package-rpm :
280+ name : Package RPM (Fedora)
281+ if : startsWith(github.ref, 'refs/tags/')
282+ runs-on : ubuntu-latest
283+ container :
284+ image : fedora:40
285+
286+ steps :
287+ - name : Install base tools
288+ run : |
289+ dnf install -y git
290+
291+ - uses : actions/checkout@v4
292+
293+ - name : Wait for Plugin Build
294+ uses : yogeshlonkar/wait-for-jobs@v0
295+ with :
296+ interval : ' 5000'
297+ jobs : Build GST Plugin ProjectM
298+ ttl : ' 15'
299+
300+ - name : Download Plugin Artifact
301+ uses : actions/download-artifact@v4
302+ with :
303+ name : gst-projectm-linux-latest
304+ path : plugin
305+
306+ - name : Install RPM build tools
307+ run : |
308+ dnf install -y rpm-build
309+
310+ - name : Create Binary RPM
311+ run : |
312+ VERSION="${GITHUB_REF_NAME#v}"
313+ LIBDIR=$(rpm --eval '%{_libdir}')
314+
315+ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
316+
317+ cat > ~/rpmbuild/SPECS/gst-projectm.spec << SPECEOF
318+ Name: gstreamer1-projectm
319+ Version: ${VERSION}
320+ Release: 1%{?dist}
321+ Summary: GStreamer plugin for projectM audio visualization
322+ License: LGPLv2+
323+ URL: https://github.com/projectM-visualizer/gst-projectm
324+
325+ AutoReqProv: no
326+ Requires: gstreamer1 >= 1.20
327+ Requires: gstreamer1-plugins-base >= 1.20
328+
329+ %description
330+ This package provides a GStreamer plugin that uses the projectM library
331+ to render audio visualizations. It can be used with any GStreamer pipeline
332+ to add real-time music visualizations.
333+
334+ Requires projectM (libprojectM) to be installed separately.
335+
336+ %install
337+ mkdir -p %{buildroot}${LIBDIR}/gstreamer-1.0
338+ install -m 0755 ${GITHUB_WORKSPACE}/plugin/libgstprojectm.so %{buildroot}${LIBDIR}/gstreamer-1.0/
339+
340+ %files
341+ %license LICENSE
342+ ${LIBDIR}/gstreamer-1.0/libgstprojectm.so
343+
344+ %changelog
345+ * $(date '+%a %b %d %Y') projectM Visualizer <[email protected] > - ${VERSION}-1 346+ - Release ${VERSION}
347+ SPECEOF
348+
349+ rpmbuild -bb ~/rpmbuild/SPECS/gst-projectm.spec
350+
351+ find ~/rpmbuild/RPMS -name "*.rpm" -exec cp {} ${GITHUB_WORKSPACE}/ \;
352+
353+ - name : Upload RPM Package
354+ uses : actions/upload-artifact@v4
355+ with :
356+ name : release-rpm-fedora40
357+ path : " *.rpm"
358+
359+ package-srpm :
360+ name : Package Source RPM
361+ if : startsWith(github.ref, 'refs/tags/')
362+ runs-on : ubuntu-latest
363+ container :
364+ image : fedora:40
365+
366+ steps :
367+ - name : Install base tools
368+ run : |
369+ dnf install -y git rpm-build
370+
371+ - uses : actions/checkout@v4
372+
373+ - name : Create Source RPM
374+ run : |
375+ VERSION="${GITHUB_REF_NAME#v}"
376+
377+ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
378+
379+ # Create source tarball
380+ tar czf ~/rpmbuild/SOURCES/gst-projectm-${VERSION}.tar.gz \
381+ --transform "s,^,gst-projectm-${VERSION}/," \
382+ --exclude=build --exclude=dist --exclude=.git \
383+ --exclude=plugin --exclude="*.rpm" \
384+ .
385+
386+ cat > ~/rpmbuild/SPECS/gst-projectm.spec << SPECEOF
387+ Name: gstreamer1-projectm
388+ Version: ${VERSION}
389+ Release: 1%{?dist}
390+ Summary: GStreamer plugin for projectM audio visualization
391+ License: LGPLv2+
392+ URL: https://github.com/projectM-visualizer/gst-projectm
393+ Source0: gst-projectm-%{version}.tar.gz
394+
395+ BuildRequires: cmake >= 3.21
396+ BuildRequires: ninja-build
397+ BuildRequires: gcc
398+ BuildRequires: gcc-c++
399+ BuildRequires: pkgconfig
400+ BuildRequires: mesa-libGL-devel
401+ BuildRequires: mesa-libEGL-devel
402+ BuildRequires: gstreamer1-devel >= 1.20
403+ BuildRequires: gstreamer1-plugins-base-devel >= 1.20
404+ BuildRequires: glib2-devel
405+ Requires: gstreamer1 >= 1.20
406+ Requires: gstreamer1-plugins-base >= 1.20
407+
408+ %description
409+ This package provides a GStreamer plugin that uses the projectM library
410+ to render audio visualizations.
411+
412+ %prep
413+ %setup -q -n gst-projectm-%{version}
414+
415+ %build
416+ %cmake -G Ninja
417+ %cmake_build
418+
419+ %install
420+ mkdir -p %{buildroot}%{_libdir}/gstreamer-1.0
421+ install -m 0755 %{_vpath_builddir}/libgstprojectm.so %{buildroot}%{_libdir}/gstreamer-1.0/
422+
423+ %files
424+ %license LICENSE
425+ %{_libdir}/gstreamer-1.0/libgstprojectm.so
426+
427+ %changelog
428+ * $(date '+%a %b %d %Y') projectM Visualizer <[email protected] > - ${VERSION}-1 429+ - Release ${VERSION}
430+ SPECEOF
431+
432+ rpmbuild -bs ~/rpmbuild/SPECS/gst-projectm.spec
433+
434+ find ~/rpmbuild/SRPMS -name "*.src.rpm" -exec cp {} ${GITHUB_WORKSPACE}/ \;
435+
436+ - name : Upload Source RPM
437+ uses : actions/upload-artifact@v4
438+ with :
439+ name : release-srpm
440+ path : " *.src.rpm"
0 commit comments