From 0094cb7b6f4522c5ff691ec43e5a8d551b6b6d29 Mon Sep 17 00:00:00 2001 From: Paul Gregoire Date: Fri, 23 Oct 2026 21:54:54 -0700 Subject: [PATCH] Ship the CLI in releases; build Windows only on request The Linux job packages moq2ts-cli as its own AppImage and smoke-tests it. The macOS bundle carries moq2ts-cli, deployed with macdeployqt. The Windows zip carries moq2ts-cli.exe. The Windows job runs only from a manual dispatch with windows set or when the repository variable BUILD_WINDOWS is true; the release job accepts a skipped Windows build. The receiver is not packaged: it needs an installed moq5, which has no prebuilt SDK. --- .github/workflows/build.yml | 52 +++++++++++++++++++++++++++++++++++-- README.md | 14 +++++++--- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8d5f5c..8b9bc40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,12 @@ on: tags: ['v*'] pull_request: branches: [main] + workflow_dispatch: + inputs: + windows: + description: Build the Windows package + type: boolean + default: false # Allow the release job to create GitHub Releases and upload assets. permissions: @@ -110,6 +116,35 @@ jobs: mkdir -p dist mv "$OUTPUT" dist/ + - name: Package CLI AppImage + env: + APPIMAGE_EXTRACT_AND_RUN: 1 + QMAKE: /usr/lib/qt6/bin/qmake6 + OUTPUT: moq2ts-cli-linux-x86_64.AppImage + run: | + set -eux + mkdir -p cli-appdir/usr/share/applications \ + cli-appdir/usr/share/icons/hicolor/256x256/apps + cat > cli-appdir/usr/share/applications/moq2ts-cli.desktop <<'EOF' + [Desktop Entry] + Type=Application + Name=moq2ts CLI + Exec=moq2ts-cli + Icon=moq2ts-cli + Categories=AudioVideo; + Terminal=true + EOF + convert -size 256x256 xc:'#1565c0' \ + cli-appdir/usr/share/icons/hicolor/256x256/apps/moq2ts-cli.png + ./linuxdeploy-x86_64.AppImage --appdir cli-appdir --plugin qt \ + --executable build/moq2ts-cli \ + --desktop-file cli-appdir/usr/share/applications/moq2ts-cli.desktop \ + --output appimage + mv "$OUTPUT" dist/ + # The packaged CLI starts and prints its options. + chmod +x "dist/$OUTPUT" + "./dist/$OUTPUT" --help | grep -q -- --endpoint + - uses: actions/upload-artifact@v5 with: name: moq2ts-linux @@ -158,7 +193,12 @@ jobs: run: | set -eux APP="build/moq2ts-publisher.app" - "$(brew --prefix qt)/bin/macdeployqt" "$APP" -verbose=1 + # moq2ts-cli goes into the bundle so macdeployqt fixes up its Qt and + # library paths too; run it as moq2ts-publisher.app/Contents/MacOS/moq2ts-cli. + cp build/moq2ts-cli "$APP/Contents/MacOS/" + "$(brew --prefix qt)/bin/macdeployqt" "$APP" -verbose=1 \ + -executable="$APP/Contents/MacOS/moq2ts-cli" + "$APP/Contents/MacOS/moq2ts-cli" --help | grep -q -- --endpoint mkdir -p dist ditto -c -k --keepParent "$APP" dist/moq2ts-publisher-macos.zip @@ -170,6 +210,9 @@ jobs: windows: name: windows (x86_64) + # Off by default: run it from a manual dispatch with "windows" set, or set + # the repository variable BUILD_WINDOWS to "true" to build it on every run. + if: ${{ inputs.windows || vars.BUILD_WINDOWS == 'true' }} # The image moqxr releases its SDK on: its static libraries call MSVC STL # helpers that an older toolset cannot link. runs-on: windows-latest @@ -230,6 +273,7 @@ jobs: $stage = "dist\moq2ts-publisher" New-Item -ItemType Directory -Force -Path $stage | Out-Null Copy-Item build\Release\moq2ts-publisher.exe $stage\ + Copy-Item build\Release\moq2ts-cli.exe $stage\ # Bundle the Qt runtime/plugins. & "$env:QT_ROOT_DIR\bin\windeployqt.exe" --release --no-translations --compiler-runtime "$stage\moq2ts-publisher.exe" # Bundle the vcpkg codec DLLs (ffmpeg/openh264/opus and their deps). @@ -249,7 +293,11 @@ jobs: name: release needs: [linux, macos, windows] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') + # Windows is optional (see its job): a skipped Windows build still releases. + if: >- + ${{ !cancelled() && startsWith(github.ref, 'refs/tags/v') + && needs.linux.result == 'success' && needs.macos.result == 'success' + && contains(fromJSON('["success","skipped"]'), needs.windows.result) }} steps: - uses: actions/download-artifact@v5 with: diff --git a/README.md b/README.md index d084714..f7b8863 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,16 @@ GitHub Actions builds Linux, macOS, and Windows packages on every push and pull request (see the [Build workflow](.github/workflows/build.yml)): - **Linux** — `moq2ts-publisher-linux-x86_64.AppImage` (self-contained; `chmod +x` - and run) -- **macOS** — `moq2ts-publisher-macos.zip` (a bundled `.app`) -- **Windows** — `moq2ts-publisher-windows.zip` (the `.exe` with its Qt and codec - DLLs) + and run) and `moq2ts-cli-linux-x86_64.AppImage`, the command-line publisher +- **macOS** — `moq2ts-publisher-macos.zip` (a bundled `.app`; the command-line + publisher is `moq2ts-publisher.app/Contents/MacOS/moq2ts-cli`) +- **Windows** — `moq2ts-publisher-windows.zip` (the `.exe` and `moq2ts-cli.exe` + with their Qt and codec DLLs). The Windows build is off by default: start the + workflow by hand with `windows` set, or set the repository variable + `BUILD_WINDOWS` to `true`. A release without it has no Windows asset. + +The receiver (`moq2ts-receiver`) is not packaged: it needs an installed moq5, +which has no prebuilt SDK yet (see [docs/CLI.md](docs/CLI.md#receive-mpeg-ts-from-a-relay)). Per-commit packages are attached to each run on the Actions tab. Tagged releases (`v*`) additionally publish these assets to a GitHub Release.