diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 8d4873d..97fd8ba 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -78,7 +78,24 @@ jobs: # RPM: { "artifact", "container", "build_tag", "arch" } distros_deb: ${{ steps.set.outputs.distros_deb }} distros_rpm: ${{ steps.set.outputs.distros_rpm }} + # Variant lists (narrowed on PRs to dynamic only). + plugin_variants: ${{ steps.variants.outputs.plugin_variants }} + gl_variants: ${{ steps.variants.outputs.gl_variants }} + build_static: ${{ steps.variants.outputs.build_static }} steps: + - name: Determine build variants + id: variants + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo 'plugin_variants=["dynamic"]' >> $GITHUB_OUTPUT + echo 'gl_variants=[]' >> $GITHUB_OUTPUT + echo 'build_static=false' >> $GITHUB_OUTPUT + else + echo 'plugin_variants=["static-gl","static-gles","dynamic"]' >> $GITHUB_OUTPUT + echo 'gl_variants=["gl","gles"]' >> $GITHUB_OUTPUT + echo 'build_static=true' >> $GITHUB_OUTPUT + fi + - name: Normalize distro families id: set shell: bash @@ -146,11 +163,12 @@ jobs: build-projectm-deb: name: Build ProjectM (${{ matrix.image.tag }}, static-${{ matrix.gl_variant }}) needs: [configure] + if: needs.configure.outputs.build_static == 'true' runs-on: ${{ matrix.image.runner }} strategy: matrix: image: ${{ fromJSON(needs.configure.outputs.build_images_deb) }} - gl_variant: [gl, gles] + gl_variant: ${{ fromJSON(needs.configure.outputs.gl_variants) }} include: - gl_variant: gl enable_gles: "OFF" @@ -209,14 +227,14 @@ jobs: build-projectm-rpm: name: Build ProjectM (${{ matrix.image.tag }}, static-${{ matrix.gl_variant }}) needs: [configure] - if: ${{ needs.configure.outputs.build_images_rpm != '[]' }} + if: ${{ needs.configure.outputs.build_images_rpm != '[]' && needs.configure.outputs.build_static == 'true' }} runs-on: ubuntu-latest container: image: ${{ matrix.image.container }} strategy: matrix: image: ${{ fromJSON(needs.configure.outputs.build_images_rpm) }} - gl_variant: [gl, gles] + gl_variant: ${{ fromJSON(needs.configure.outputs.gl_variants) }} include: - gl_variant: gl enable_gles: "OFF" @@ -354,7 +372,7 @@ jobs: strategy: matrix: image: ${{ fromJSON(needs.configure.outputs.build_images_deb) }} - variant: [static-gl, static-gles, dynamic] + variant: ${{ fromJSON(needs.configure.outputs.plugin_variants) }} steps: - uses: actions/checkout@v4 with: @@ -439,7 +457,7 @@ jobs: strategy: matrix: image: ${{ fromJSON(needs.configure.outputs.build_images_rpm) }} - variant: [static-gl, static-gles, dynamic] + variant: ${{ fromJSON(needs.configure.outputs.plugin_variants) }} steps: - name: Install build dependencies run: dnf install -y git cmake ninja-build gcc gcc-c++ pkgconfig patchelf mesa-libGL-devel mesa-libEGL-devel mesa-libGLES-devel gstreamer1-devel gstreamer1-plugins-base-devel glib2-devel diff --git a/.github/workflows/build_osx.yml b/.github/workflows/build_osx.yml index 787866a..a4207f3 100644 --- a/.github/workflows/build_osx.yml +++ b/.github/workflows/build_osx.yml @@ -15,24 +15,30 @@ env: PROJECTM_REF: master jobs: + configure: + name: Configure + runs-on: ubuntu-latest + outputs: + projectm_matrix: ${{ steps.set.outputs.projectm_matrix }} + plugin_matrix: ${{ steps.set.outputs.plugin_matrix }} + steps: + - id: set + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo 'projectm_matrix=[{"variant":"shared","shared":"ON","enable_gles":"OFF","extra_flags":""}]' >> $GITHUB_OUTPUT + echo 'plugin_matrix=[{"variant":"dynamic","projectm_artifact":"projectm-osx-arm64-shared-latest"}]' >> $GITHUB_OUTPUT + else + echo 'projectm_matrix=[{"variant":"static-gl","shared":"OFF","enable_gles":"OFF","extra_flags":"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"},{"variant":"static-gles","shared":"OFF","enable_gles":"ON","extra_flags":"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"},{"variant":"shared","shared":"ON","enable_gles":"OFF","extra_flags":""}]' >> $GITHUB_OUTPUT + echo 'plugin_matrix=[{"variant":"static-gl","projectm_artifact":"projectm-osx-arm64-static-gl-latest"},{"variant":"static-gles","projectm_artifact":"projectm-osx-arm64-static-gles-latest"},{"variant":"dynamic","projectm_artifact":"projectm-osx-arm64-shared-latest"}]' >> $GITHUB_OUTPUT + fi + build-projectm: name: Build ProjectM (${{ matrix.variant }}) + needs: [configure] runs-on: macos-14 strategy: matrix: - include: - - variant: static-gl - shared: "OFF" - enable_gles: "OFF" - extra_flags: "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" - - variant: static-gles - shared: "OFF" - enable_gles: "ON" - extra_flags: "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" - - variant: shared - shared: "ON" - enable_gles: "OFF" - extra_flags: "" + include: ${{ fromJson(needs.configure.outputs.projectm_matrix) }} steps: - uses: actions/checkout@v4 with: @@ -84,17 +90,11 @@ jobs: build-plugin: name: Build GST Plugin (${{ matrix.variant }}) - needs: [build-projectm] + needs: [configure, build-projectm] runs-on: macos-14 strategy: matrix: - include: - - variant: static-gl - projectm_artifact: projectm-osx-arm64-static-gl-latest - - variant: static-gles - projectm_artifact: projectm-osx-arm64-static-gles-latest - - variant: dynamic - projectm_artifact: projectm-osx-arm64-shared-latest + include: ${{ fromJson(needs.configure.outputs.plugin_matrix) }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/build_portable.yml b/.github/workflows/build_portable.yml index 8fcbfb0..b6479a4 100644 --- a/.github/workflows/build_portable.yml +++ b/.github/workflows/build_portable.yml @@ -3,13 +3,9 @@ name: Linux Portable on: push: branches: - - "*" + - master tags: - - "*" - - pull_request: - branches: - - "*" + - "v*" env: # ── ProjectM source configuration ────────────────────────────────── @@ -358,7 +354,7 @@ jobs: - '# Any arguments are forwarded to gst-launch-1.0 as-is.' - 'export GST_PLUGIN_PATH=/app/lib/gstreamer-1.0' - 'if [ $# -eq 0 ]; then' - - ' exec gst-launch-1.0 autoaudiosrc ! audioconvert ! audioresample ! "audio/x-raw, format=S16LE, rate=44100, channels=2, layout=interleaved" ! queue ! projectm ! "video/x-raw(memory:GLMemory),width=1024,height=768,framerate=30/1" ! glimagesink sync=false' + - ' exec gst-launch-1.0 autoaudiosrc ! audioconvert ! audioresample ! "audio/x-raw, format=S16LE, rate=44100, channels=2, layout=interleaved" ! queue ! projectm ! "video/x-raw(memory:GLMemory),width=1024,height=768,framerate=60/1" ! glimagesink sync=false' - 'else' - ' exec gst-launch-1.0 "$@"' - 'fi' @@ -743,7 +739,7 @@ jobs: # With no arguments, runs a default visualization pipeline. # Any arguments are forwarded to gst-launch-1.0 as-is. if [ \$# -eq 0 ]; then - exec "\${HERE}/gst-launch-1.0" autoaudiosrc ! audioconvert ! audioresample ! "audio/x-raw, format=S16LE, rate=44100, channels=2, layout=interleaved" ! queue ! projectm ! "video/x-raw(memory:GLMemory),width=1024,height=768,framerate=30/1" ! glimagesink sync=false + exec "\${HERE}/gst-launch-1.0" autoaudiosrc ! audioconvert ! audioresample ! "audio/x-raw, format=S16LE, rate=44100, channels=2, layout=interleaved" ! queue ! projectm ! "video/x-raw(memory:GLMemory),width=1024,height=768,framerate=60/1" ! glimagesink sync=false else exec "\${HERE}/gst-launch-1.0" "\$@" fi diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index cefca9f..2f99fcf 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -5,7 +5,7 @@ on: branches: - "*" tags: - - "*" + - "v*" pull_request: branches: @@ -15,24 +15,32 @@ env: PROJECTM_REF: master jobs: + configure: + name: Configure + runs-on: ubuntu-latest + outputs: + projectm_matrix: ${{ steps.set.outputs.projectm_matrix }} + plugin_matrix: ${{ steps.set.outputs.plugin_matrix }} + steps: + - id: set + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + # PRs: dynamic only + echo 'projectm_matrix=[{"variant":"shared","shared":"ON","enable_gles":"OFF","extra_flags":""}]' >> $GITHUB_OUTPUT + echo 'plugin_matrix=[{"variant":"dynamic","projectm_artifact":"projectm-windows-shared-latest"}]' >> $GITHUB_OUTPUT + else + # Push (branches + tags): all variants + echo 'projectm_matrix=[{"variant":"static-gl","shared":"OFF","enable_gles":"OFF","extra_flags":"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"},{"variant":"static-gles","shared":"OFF","enable_gles":"ON","extra_flags":"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"},{"variant":"shared","shared":"ON","enable_gles":"OFF","extra_flags":""}]' >> $GITHUB_OUTPUT + echo 'plugin_matrix=[{"variant":"static-gl","projectm_artifact":"projectm-windows-static-gl-latest"},{"variant":"static-gles","projectm_artifact":"projectm-windows-static-gles-latest"},{"variant":"dynamic","projectm_artifact":"projectm-windows-shared-latest"}]' >> $GITHUB_OUTPUT + fi + build-projectm: name: Build ProjectM (${{ matrix.variant }}) + needs: [configure] runs-on: windows-latest strategy: matrix: - include: - - variant: static-gl - shared: "OFF" - enable_gles: "OFF" - extra_flags: "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" - - variant: static-gles - shared: "OFF" - enable_gles: "ON" - extra_flags: "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" - - variant: shared - shared: "ON" - enable_gles: "OFF" - extra_flags: "" + include: ${{ fromJson(needs.configure.outputs.projectm_matrix) }} env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: @@ -49,6 +57,15 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Restore vcpkg cache (PR only) + if: github.event_name == 'pull_request' + uses: actions/cache/restore@v4 + with: + path: C:/vcpkg/installed + key: vcpkg-${{ runner.os }}-x64-windows-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + restore-keys: | + vcpkg-${{ runner.os }}-x64-windows- + - name: Get Hash id: git-hash run: echo "hash=$(git rev-parse HEAD)-${{ matrix.variant }}v4" >> $Env:GITHUB_OUTPUT @@ -81,19 +98,20 @@ jobs: name: projectm-windows-${{ matrix.variant }}-latest path: install/* + - name: Save vcpkg cache (push only) + if: github.event_name == 'push' + uses: actions/cache/save@v4 + with: + path: C:/vcpkg/installed + key: vcpkg-${{ runner.os }}-x64-windows-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + build-plugin: name: Build GST Plugin (${{ matrix.variant }}) - needs: [build-projectm] + needs: [configure, build-projectm] runs-on: windows-latest strategy: matrix: - include: - - variant: static-gl - projectm_artifact: projectm-windows-static-gl-latest - - variant: static-gles - projectm_artifact: projectm-windows-static-gles-latest - - variant: dynamic - projectm_artifact: projectm-windows-shared-latest + include: ${{ fromJson(needs.configure.outputs.plugin_matrix) }} env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: @@ -101,6 +119,22 @@ jobs: with: submodules: 'recursive' + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Restore vcpkg cache (PR only) + if: github.event_name == 'pull_request' + uses: actions/cache/restore@v4 + with: + path: C:/vcpkg/installed + key: vcpkg-${{ runner.os }}-x64-windows-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + restore-keys: | + vcpkg-${{ runner.os }}-x64-windows- + - uses: actions/download-artifact@v4 with: name: ${{ matrix.projectm_artifact }} @@ -155,9 +189,16 @@ jobs: name: gst-projectm-windows-${{ matrix.variant }}-latest path: ${{ github.workspace }}\cmake-build\Release\*.dll + - name: Save vcpkg cache (push only) + if: github.event_name == 'push' + uses: actions/cache/save@v4 + with: + path: C:/vcpkg/installed + key: vcpkg-${{ runner.os }}-x64-windows-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + package: name: Package Windows (${{ matrix.label }}) - needs: [build-plugin] + needs: [configure, build-plugin] runs-on: windows-latest if: startsWith(github.ref, 'refs/tags/') strategy: diff --git a/README.md b/README.md index 6798643..8aea90f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ There are several ways to get the plugin, depending on what you need: | **Docker container** | One-command audio-to-video conversion. No setup required. | Quick audio-to-video rendering | [Docker conversion](#easy-audio-to-video-conversion) | | **Flatpak / AppImage** | Self-contained bundles that ship their own GStreamer and run `gst-launch-1.0` directly. No system GStreamer needed. | Quick testing without installing anything | **[Linux — Portable Bundles](docs/LINUX.md#portable-bundles-flatpak--appimage)** | -Packages that install the plugin (DEB, RPM, ZIP, tar.gz) place a single shared library (`libgstprojectm.so` / `.dylib` / `.dll`) into your GStreamer plugin path. After that, the `projectm` element is available in every pipeline on the system. The Flatpak and AppImage bundles are different — they are self-contained executables that include their own copy of GStreamer and are intended for quick testing, not as a way to add the plugin to your system. +Packages that install the plugin (DEB, RPM, ZIP, tar.gz) place a single shared library (`libgstprojectm.so` / `.dll`) into your GStreamer plugin path. After that, the `projectm` element is available in every pipeline on the system. The Flatpak and AppImage bundles are different — they are self-contained executables that include their own copy of GStreamer and are intended for quick testing, not as a way to add the plugin to your system.