From c8bed71c4a2e75f4a3b23a9cd511cdbb5a005190 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 22 Jul 2024 14:09:34 +0100 Subject: [PATCH] feat: add debian packaging --- .../workflows/test-build-stream-sprout.yml | 59 +++++++++++++++++++ debian/changelog | 5 ++ debian/control | 25 ++++++++ debian/copyright | 45 ++++++++++++++ debian/install | 1 + debian/rules | 7 +++ debian/source/format | 1 + devshell.nix | 2 +- package.nix | 2 +- 9 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-build-stream-sprout.yml create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.github/workflows/test-build-stream-sprout.yml b/.github/workflows/test-build-stream-sprout.yml new file mode 100644 index 0000000..7cbe948 --- /dev/null +++ b/.github/workflows/test-build-stream-sprout.yml @@ -0,0 +1,59 @@ +name: Test build stream-sprout 🚧 + +on: + pull_request: + branches: + - main + paths: + - stream-sprout + - debian/** + - flake.nix + - package.nix + push: + branches: + - main + paths: + - stream-sprout + - debian/** + - flake.nix + - package.nix + workflow_dispatch: + +# TODO: arm64 runner +# https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/ + +jobs: + test-deb-build: + runs-on: ubuntu-24.04 + steps: + - name: "Checkout 🥡" + uses: actions/checkout@v4 + - name: "Build & Test .deb 🍥" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + sudo apt-get -y update + sudo apt-get -y install debhelper devscripts + REL_VER=$(grep "^readonly VERSION" stream-sprout | cut -d'"' -f2) + rm debian/changelog + dch --package stream-sprout --newversion="${REL_VER}-1" --distribution=unstable "New upstream release." --create + dpkg-buildpackage --build=binary --no-check-builddeps --compression=gzip + sudo apt-get -y install ../stream-sprout_${REL_VER}-1_all.deb + + test-nix-build: + runs-on: ubuntu-24.04 + permissions: + id-token: "write" + contents: "read" + steps: + - name: "Checkout 🥡" + uses: "actions/checkout@v4" + - name: "Install Nix ❄️" + uses: "DeterminateSystems/nix-installer-action@v12" + - name: "Enable Magic Nix Cache 🪄" + uses: "DeterminateSystems/magic-nix-cache-action@v7" + - name: "Build & Test .nix ❄️" + run: | + nix build .#stream-sprout + tree ./result + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5a977af --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +stream-sprout (0.1.0-1) unstable; urgency=medium + + * New upstream release. + + -- Martin Wimpress Mon, 22 Jul 2024 13:15:42 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..13858e0 --- /dev/null +++ b/debian/control @@ -0,0 +1,25 @@ +Source: stream-sprout +Section: utils +Priority: optional +Maintainer: Martin Wimpress +Build-Depends: + debhelper-compat (= 12), +Standards-Version: 4.5.1 +Homepage: https://github.com/wimpys-world/stream-sprout +Vcs-Browser: https://github.com/wimpys-world/stream-sprout +Vcs-Git: https://github.com/wimpys-world/stream-sprout.git +Rules-Requires-Root: no + +Package: stream-sprout +Architecture: all +Depends: + coreutils, + ffmpeg, + procps, + yq, + ${misc:Depends}, + ${shlibs:Depends}, +Description: Restream to multiple destinations with ease. + Stream Sprout uses FFmpeg to re-stream a video source to multiple destinations + such as Twitch, YouTube, and Owncast. + . diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..e44a6a9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,45 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: stream-sprout +Upstream-Contact: Martin Wimpress +Source: https://github.com/wimpys-world/stream-sprout + +Files: * +Copyright: 2024 Martin Wimpress +License: APACHE-2.0 + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2024 Martin Wimpress +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..d370297 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +stream-sprout usr/bin diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..3d706f5 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_builddeb: + dh_builddeb -- -Zgzip diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/devshell.nix b/devshell.nix index a5ab001..c7a01d0 100644 --- a/devshell.nix +++ b/devshell.nix @@ -7,7 +7,7 @@ mkShell { packages = with pkgs; ([ ffmpeg-headless procps - yq-go + yq ]); shellHook = '' diff --git a/package.nix b/package.nix index 9060538..92dddc8 100644 --- a/package.nix +++ b/package.nix @@ -4,7 +4,7 @@ , stdenv , ffmpeg-headless , procps -, yq-go +, yq }: let runtimePaths = [