From c031e86e9cc501e6b85a755b5865fd2f0887f0a1 Mon Sep 17 00:00:00 2001 From: unpackerr-auto-releaser Date: Wed, 31 Jul 2024 09:46:34 -0700 Subject: [PATCH 1/2] create binary arch package for github release --- .github/workflows/release.yml | 3 +- Makefile | 63 +++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd4e806b..073ba988 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: - name: make-release id: release run: | - sudo apt install -y rpm fakeroot zip debsigs gnupg jq + sudo apt install -y rpm fakeroot zip debsigs gnupg jq libarchive-tools sudo gem install --no-document fpm echo "${GPG_SIGNING_KEY}" | gpg --import - make release @@ -164,6 +164,7 @@ jobs: *.dmg *.gz *.txt + *.zst archlinux-aur: # description: creates and uploads and aur file to the golift/aur repo for arch linux. diff --git a/Makefile b/Makefile index 77d5939a..3398fcfd 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ release: clean linux_packages freebsd_packages windows mv unpackerr.*.linux unpackerr.*.freebsd $@/ gzip -9r $@/ for i in unpackerr*.exe ; do zip -9qj $@/$$i.zip $$i examples/*.example *.html; rm -f $$i;done - mv *.rpm *.deb *.txz $@/ + mv *.rpm *.deb *.txz *.zst $@/ # Generating File Hashes openssl dgst -r -sha256 $@/* | sed 's#release/##' | tee $@/checksums.sha256.txt @@ -102,6 +102,11 @@ rsrc: rsrc.syso rsrc.syso: init/windows/application.ico init/windows/manifest.xml go run github.com/akavel/rsrc@latest -arch amd64 -ico init/windows/application.ico -manifest init/windows/manifest.xml +generate: examples/unpackerr.conf.example +examples/unpackerr.conf.example: init/config/* + find pkg -name .DS\* -delete + go generate ./... + #################### ##### Binaries ##### #################### @@ -166,7 +171,7 @@ unpackerr.amd64.exe: generate rsrc.syso main.go ##### Packages ##### #################### -linux_packages: rpm deb rpm386 deb386 debarm rpmarm debarmhf rpmarmhf +linux_packages: rpm deb zst rpm386 deb386 debarm rpmarm zstarm debarmhf rpmarmhf zstarmhf freebsd_packages: freebsd_pkg freebsd386_pkg freebsdarm_pkg @@ -240,8 +245,23 @@ unpackerr-$(VERSION)_$(ITERATION).armhf.txz: package_build_freebsd_arm check_fpm @echo "Building 32-bit ARM6/7 HF 'freebsd pkg' package for unpackerr version '$(VERSION)-$(ITERATION)'." fpm -s dir -t freebsd $(PACKAGE_ARGS) -a arm -v $(VERSION) -p $@ -C $< $(EXTRA_FPM_FLAGS) +zst: unpackerr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst +unpackerr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst: package_build_linux_zst check_fpm + @echo "Building 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a x86_64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) + +zstarm: unpackerr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst +unpackerr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst: package_build_linux_aarch64_zst check_fpm + @echo "Building 64-bit ARM8 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a aarch64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) + +zstarmhf: unpackerr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst +unpackerr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst: package_build_linux_armhf_zst check_fpm + @echo "Building 32-bit ARM6/7 HF 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) + # Build an environment that can be packaged for linux. -package_build_linux_rpm: readme man linux +package_build_linux_rpm: generate readme man linux # Building package environment for linux. mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 $@/usr/share/doc/unpackerr $@/usr/lib/unpackerr # Copying the binary, config file, unit file, and man page into the env. @@ -255,7 +275,7 @@ package_build_linux_rpm: readme man linux [ ! -d "init/linux/rpm" ] || cp -r init/linux/rpm/* $@ # Build an environment that can be packaged for linux. -package_build_linux_deb: readme man linux +package_build_linux_deb: generate readme man linux # Building package environment for linux. mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 $@/usr/share/doc/unpackerr $@/usr/lib/unpackerr # Copying the binary, config file, unit file, and man page into the env. @@ -268,6 +288,24 @@ package_build_linux_deb: readme man linux cp init/systemd/unpackerr.service $@/lib/systemd/system/ [ ! -d "init/linux/deb" ] || cp -r init/linux/deb/* $@ +# Build an environment that can be packaged for arch linux. +package_build_linux_zst: generate readme man linux unpackerr.conf.example + # Building package environment for linux. + mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 \ + $@/usr/share/licenses/unpackerr $@/usr/share/doc/unpackerr $@/var/log/unpackerr + # Copying the binary, config file, unit file, and man page into the env. + cp unpackerr.amd64.linux $@/usr/bin/unpackerr + cp *.1.gz $@/usr/share/man/man1 + cp unpackerr.conf.example $@/etc/unpackerr/ + cp unpackerr.conf.example $@/etc/unpackerr/unpackerr.conf + cp LICENSE $@/usr/share/licenses/unpackerr + cp *.html examples/*?.?* $@/usr/share/doc/unpackerr/ + mkdir -p $@/usr/lib/systemd/system $@/usr/lib/sysusers.d + echo "u unpackerr - \"unpackerr daemon\"" > $@/usr/lib/sysusers.d/unpackerr.conf + chmod 775 $@/var/log/unpackerr $@/usr/share/doc/unpackerr $@/etc/unpackerr + cp init/systemd/unpackerr.service $@/usr/lib/systemd/system/ + [ ! -d "init/linux/zst" ] || cp -r init/linux/zst/* $@ + package_build_linux_386_deb: package_build_linux_deb linux386 mkdir -p $@ cp -r $ Date: Wed, 31 Jul 2024 09:51:47 -0700 Subject: [PATCH 2/2] fix some paths --- Makefile | 6 +++--- examples/docker-compose.yml | 2 +- examples/unpackerr.conf.example | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3398fcfd..20dde28b 100644 --- a/Makefile +++ b/Makefile @@ -289,15 +289,15 @@ package_build_linux_deb: generate readme man linux [ ! -d "init/linux/deb" ] || cp -r init/linux/deb/* $@ # Build an environment that can be packaged for arch linux. -package_build_linux_zst: generate readme man linux unpackerr.conf.example +package_build_linux_zst: generate readme man linux # Building package environment for linux. mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 \ $@/usr/share/licenses/unpackerr $@/usr/share/doc/unpackerr $@/var/log/unpackerr # Copying the binary, config file, unit file, and man page into the env. cp unpackerr.amd64.linux $@/usr/bin/unpackerr cp *.1.gz $@/usr/share/man/man1 - cp unpackerr.conf.example $@/etc/unpackerr/ - cp unpackerr.conf.example $@/etc/unpackerr/unpackerr.conf + cp examples/unpackerr.conf.example $@/etc/unpackerr/ + cp examples/unpackerr.conf.example $@/etc/unpackerr/unpackerr.conf cp LICENSE $@/usr/share/licenses/unpackerr cp *.html examples/*?.?* $@/usr/share/doc/unpackerr/ mkdir -p $@/usr/lib/systemd/system $@/usr/lib/sysusers.d diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 46aaae74..a09ea28a 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -135,4 +135,4 @@ services: - UN_CMDHOOK_0_EXCLUDE_1=lidarr - UN_CMDHOOK_0_TIMEOUT=10s -## => Content Auto Generated, 17 JUL 2024 16:48 UTC +## => Content Auto Generated, 31 JUL 2024 16:50 UTC diff --git a/examples/unpackerr.conf.example b/examples/unpackerr.conf.example index 9b8ac317..f7f5ebef 100644 --- a/examples/unpackerr.conf.example +++ b/examples/unpackerr.conf.example @@ -301,4 +301,4 @@ dir_mode = "0755" ## You can adjust how long to wait for the command to run. # timeout = "10s" -## => Content Auto Generated, 17 JUL 2024 16:48 UTC +## => Content Auto Generated, 31 JUL 2024 16:50 UTC