From 95b201e983d143060f5cf00482d713afaf57900d Mon Sep 17 00:00:00 2001 From: notifiarr-auto-releaser Date: Mon, 29 Jul 2024 21:43:45 -0700 Subject: [PATCH] arch --- .github/workflows/release.yml | 33 ++++++++-------- Makefile | 72 ++++++++++++++++++++++++++--------- pkg/ui/ui_freebsd.go | 4 ++ pkg/ui/ui_linux.go | 4 ++ 4 files changed, 78 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9166d82b..7d27e9c79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -118,7 +118,7 @@ jobs: name: ${{ matrix.files }} - name: Upload files to unstable.golift.io run: >- - for file in *.{zip,dmg,gz}; do + for file in *.{zip,dmg,gz,zst}; do [ -f "$file" ] || continue; echo "Uploading: ${file}"; curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}"; @@ -195,19 +195,20 @@ jobs: *.dmg *.gz *.txt + *.zst - archlinux-aur: - # description: creates and uploads and aur file to the golift/aur repo for arch linux. - needs: - - release - - deploy-github - name: Deploy ArchLinux AUR - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: Deploy Aurch AUR - run: bash init/archlinux/aur-deploy.sh - env: - DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }} + # archlinux-aur: + # # description: creates and uploads a PKGBUILD file to the golift/aur repo for arch linux. + # needs: + # - release + # - deploy-github + # name: Deploy ArchLinux AUR + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: '0' + # - name: Deploy Aurch AUR + # run: bash init/archlinux/aur-deploy.sh + # env: + # DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }} diff --git a/Makefile b/Makefile index 34e31ff1e..4c47f3806 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ notifiarr.1.gz: mv examples/MANUAL.html notifiarr_manual.html readme: README.html -README.html: +README.html: # This turns README.md into README.html go run github.com/davidnewhall/md2roff@v0.0.1 --manual notifiarr --version $(VERSION) --date "$(DATE)" README.md @@ -119,6 +119,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: pkg/bindata/docs/api_docs.go +pkg/bindata/docs/api_docs.go: + find pkg -name .DS\* -delete + go generate ./pkg/bindata/docs + #################### ##### Binaries ##### #################### @@ -181,7 +186,7 @@ notifiarr.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 @@ -238,11 +243,20 @@ notifiarr-$(RPMVERSION)-$(ITERATION).armhf.rpm: package_build_linux_armhf_rpm ch fpm -s dir -t rpm $(PACKAGE_ARGS) -a armhf -v $(RPMVERSION) -C $< $(EXTRA_FPM_FLAGS) [ "$(SIGNING_KEY)" = "" ] || rpmsign --key-id=$(SIGNING_KEY) --resign notifiarr-$(RPMVERSION)-$(ITERATION).armhf.rpm -debarmhf: notifiarr_$(VERSION)-$(ITERATION)_armhf.deb -notifiarr_$(VERSION)-$(ITERATION)_armhf.deb: package_build_linux_armhf_deb check_fpm - @echo "Building 32-bit ARM6/7 HF 'deb' package for notifiarr version '$(VERSION)-$(ITERATION)'." - fpm -s dir -t deb $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) - [ "$(SIGNING_KEY)" = "" ] || debsigs --default-key="$(SIGNING_KEY)" --sign=origin notifiarr_$(VERSION)-$(ITERATION)_armhf.deb +zst: notifiarr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst +notifiarr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst: package_build_linux_zst check_fpm + @echo "Building 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a x86_64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) + +zstarm: notifiarr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst +notifiarr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst: package_build_linux_aarch64_zst check_fpm + @echo "Building 64-bit ARM8 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a aarch64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) + +zstarmhf: notifiarr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst +notifiarr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst: package_build_linux_armhf_zst check_fpm + @echo "Building 32-bit ARM6/7 HF 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'." + fpm -s dir -t pacman $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS) freebsd_pkg: notifiarr-$(VERSION)_$(ITERATION).amd64.txz notifiarr-$(VERSION)_$(ITERATION).amd64.txz: package_build_freebsd check_fpm @@ -259,10 +273,10 @@ notifiarr-$(VERSION)_$(ITERATION).armhf.txz: package_build_freebsd_arm check_fpm @echo "Building 32-bit ARM6/7 HF 'freebsd pkg' package for notifiarr version '$(VERSION)-$(ITERATION)'." fpm -s dir -t freebsd $(PACKAGE_ARGS) -a arm -v $(VERSION) -p notifiarr-$(VERSION)_$(ITERATION).armhf.txz -C $< $(EXTRA_FPM_FLAGS) -# Build an environment that can be packaged for linux. -package_build_linux_rpm: readme man linux notifiarr.conf.example +# Build an environment that can be packaged for redhat linux. +package_build_linux_rpm: generate readme man linux notifiarr.conf.example # Building package environment for linux. - mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/usr/lib/notifiarr $@/var/log/notifiarr + mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr # Copying the binary, config file, unit file, and man page into the env. cp notifiarr.amd64.linux $@/usr/bin/notifiarr cp *.1.gz $@/usr/share/man/man1 @@ -273,10 +287,10 @@ package_build_linux_rpm: readme man linux notifiarr.conf.example cp init/systemd/notifiarr.service $@/lib/systemd/system/ [ ! -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 notifiarr.conf.example +# Build an environment that can be packaged for debian linux. +package_build_linux_deb: generate readme man linux notifiarr.conf.example # Building package environment for linux. - mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/usr/lib/notifiarr $@/var/log/notifiarr + mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr # Copying the binary, config file, unit file, and man page into the env. cp notifiarr.amd64.linux $@/usr/bin/notifiarr cp *.1.gz $@/usr/share/man/man1 @@ -287,6 +301,21 @@ package_build_linux_deb: readme man linux notifiarr.conf.example cp init/systemd/notifiarr.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 notifiarr.conf.example + # Building package environment for linux. + mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr + # Copying the binary, config file, unit file, and man page into the env. + cp notifiarr.amd64.linux $@/usr/bin/notifiarr + cp *.1.gz $@/usr/share/man/man1 + cp notifiarr.conf.example $@/etc/notifiarr/ + cp notifiarr.conf.example $@/etc/notifiarr/notifiarr.conf + cp LICENSE *.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/ + mkdir -p $@/usr/lib/systemd/system $@/usr/lib/sysusers.d + echo 'u notifiarr - "notifiarr.com client" -' > $@/usr/lib/sysusers.d/notifiarr.conf + cp init/systemd/notifiarr.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 $> $@/usr/local/var/log/notifiarr/buildlog.txt cp notifiarr.amd64.freebsd $@/usr/local/bin/notifiarr @@ -357,11 +396,6 @@ lint: generate GOOS=freebsd golangci-lint --build-tags nodbus run GOOS=windows golangci-lint run -generate: pkg/bindata/docs/api_docs.go -pkg/bindata/docs/api_docs.go: - find pkg -name .DS\* -delete - go generate ./pkg/bindata/docs - ################## ##### Docker ##### ################## diff --git a/pkg/ui/ui_freebsd.go b/pkg/ui/ui_freebsd.go index 9e14522cb..b5b875daa 100644 --- a/pkg/ui/ui_freebsd.go +++ b/pkg/ui/ui_freebsd.go @@ -21,6 +21,10 @@ func HasGUI() bool { // Toast does not work properly on FreeBSD because we cross compile it without dbus. :( func Toast(msg string, v ...interface{}) error { + if !hasGUI { + return nil + } + err := beeep.Notify(mnd.Title, fmt.Sprintf(msg, v...), GetPNG()) if err != nil { return fmt.Errorf("ui element failed: %w", err) diff --git a/pkg/ui/ui_linux.go b/pkg/ui/ui_linux.go index b5563a851..6e2878993 100644 --- a/pkg/ui/ui_linux.go +++ b/pkg/ui/ui_linux.go @@ -20,6 +20,10 @@ func HasGUI() bool { } func Toast(msg string, v ...interface{}) error { + if !hasGUI { + return nil + } + err := beeep.Notify(mnd.Title, fmt.Sprintf(msg, v...), GetPNG()) if err != nil { return fmt.Errorf("ui element failed: %w", err)