Skip to content

Commit

Permalink
feat: add debian packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Jul 22, 2024
1 parent 8fd84dd commit c8bed71
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/test-build-stream-sprout.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
stream-sprout (0.1.0-1) unstable; urgency=medium

* New upstream release.

-- Martin Wimpress <[email protected]> Mon, 22 Jul 2024 13:15:42 +0000
25 changes: 25 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Source: stream-sprout
Section: utils
Priority: optional
Maintainer: Martin Wimpress <[email protected]>
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.
.
45 changes: 45 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: stream-sprout
Upstream-Contact: Martin Wimpress <[email protected]>
Source: https://github.com/wimpys-world/stream-sprout

Files: *
Copyright: 2024 Martin Wimpress <[email protected]>
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 <[email protected]>
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 <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stream-sprout usr/bin
7 changes: 7 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/make -f

%:
dh $@

override_dh_builddeb:
dh_builddeb -- -Zgzip
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
2 changes: 1 addition & 1 deletion devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mkShell {
packages = with pkgs; ([
ffmpeg-headless
procps
yq-go
yq
]);

shellHook = ''
Expand Down
2 changes: 1 addition & 1 deletion package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, stdenv
, ffmpeg-headless
, procps
, yq-go
, yq
}:
let
runtimePaths = [
Expand Down

0 comments on commit c8bed71

Please sign in to comment.