Skip to content

Commit

Permalink
Update build workflow. Fix systemd unit location.
Browse files Browse the repository at this point in the history
  • Loading branch information
phnzb committed Apr 16, 2024
1 parent d3b9864 commit 1f38eb0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
build-qnap:
uses: ./.github/workflows/qnap.yml

build-linux-pkg:
uses: ./.github/workflows/linux-pkg.yml
with:
external_call: true
needs: [build-linux]
permissions:
actions: write

repack-qnap:
uses: ./.github/workflows/qnap-repack.yml
with:
Expand Down Expand Up @@ -54,6 +62,8 @@ jobs:
mv nzbget-synology-packages/* builds || true
mv nzbget-qnap-packages/* builds || true
mv nzbget-qnap-native-packages/* builds || true
mv nzbget-deb-packages/* builds || true
mv nzbget-rpm-packages/* builds || true
cd builds
VERSION=$(ls | grep bin-windows-setup | cut -d - -f 2)
if [ "$GITHUB_REF_NAME" != "main" ]; then VERSION="$VERSION-testing"; fi
Expand All @@ -65,7 +75,7 @@ jobs:
echo "nzbget_signatures({" | tee $SIGS_FILE
echo | tee -a $SIGS_FILE
for FILE in *.exe *.run *.zip *.spk *.qpkg; do
for FILE in *.exe *.run *.zip *.spk *.qpkg *.deb *.rpm; do
[ -f $FILE ] || continue
MD5=$(openssl dgst -md5 $FILE | cut -d ' ' -f 2)
Expand Down Expand Up @@ -104,9 +114,11 @@ jobs:
nzbget-synology-packages
nzbget-qnap-packages
nzbget-qnap-native-packages
nzbget-deb-packages
nzbget-rpm-packages
make-testing-release:
runs-on: [self-hosted, linux]
runs-on: [self-hosted, nzbget-linux]
needs: [generate-signatures]
permissions:
contents: write
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/linux-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
required: false
default: false
workflow_dispatch:
push:
branches:
- feature/*

jobs:
build-linux:
Expand Down
9 changes: 4 additions & 5 deletions linux/pkg/build-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ for ARCH in $ARCHS; do
# copy additional CONTENTS files
cp -r $NZBGET_ROOT/linux/pkg/deb/CONTENTS "$PWD/$ARCH/" 2>/dev/null || true
eval "echo \"$(cat ../linux/pkg/deb/DEBIAN/control)\"" > "$CONTENTS/DEBIAN/control"
mkdir -p "$CONTENTS/lib/systemd/system/"
cp ../linux/pkg/nzbget.service "$CONTENTS/lib/systemd/system/"
mkdir -p "$CONTENTS/usr/lib/systemd/system/"
cp ../linux/pkg/nzbget.service "$CONTENTS/usr/lib/systemd/system/"
# fix permissions
chmod -R u+rwX,go+rX,go-w "$CONTENTS/lib"
chmod -R u+rwX,go+rX,go-w "$CONTENTS/usr"
# remove unneeded files
find $PWD/$ARCH/ -maxdepth 1 -type f -delete
Expand All @@ -152,8 +151,8 @@ for ARCH in $ARCHS; do
cp -r $CONTENTS/usr/ $RPM_SRC
# replace 7zz with 7za (p7zip-full)
sed -i -e "s|^SevenZipCmd=.*|SevenZipCmd=7za|g" "$RPM_SRC/usr/share/nzbget/nzbget.conf"
mkdir -p "$RPM_SRC/lib/systemd/system/"
cp ../linux/pkg/nzbget.service "$RPM_SRC/lib/systemd/system/"
mkdir -p "$RPM_SRC/usr/lib/systemd/system/"
cp ../linux/pkg/nzbget.service "$RPM_SRC/usr/lib/systemd/system/"
# remove unneeded files
find $PWD/$ARCH/ -maxdepth 1 -type f ! -name "nzbget.spec" -delete
rpmbuild --define "_topdir $PWD/$ARCH" -bb $PWD/$ARCH/nzbget.spec --target $RPM_ARCH
Expand Down
4 changes: 2 additions & 2 deletions linux/pkg/rpm/nzbget.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Release: 1
Group: Applications/Internet
Provides: nzbget
Requires: systemd
Recommends: p7zip unrar
Recommends: p7zip unrar >= 6
Summary: Command-line based binary newsgrabber for nzb files, written in C++
License: GPLv2

Expand All @@ -26,7 +26,7 @@ unpack and web-interface. NZBGet requires low system resources.
/usr/bin/nzbget
/usr/share/doc/nzbget/
/usr/share/nzbget/
/lib/systemd/system/nzbget.service
/usr/lib/systemd/system/nzbget.service

%post
if [ $1 == 1 ]; then # install
Expand Down

0 comments on commit 1f38eb0

Please sign in to comment.