Skip to content

Commit

Permalink
build.yml: Add Linux package hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Markson committed Jun 17, 2023
1 parent e3f7ca0 commit 383d5bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ jobs:
--url 'https://github.com/daeuniverse/daed' --description "daed, A Modern Dashboard For dae." \
--maintainer "daed@dae.v2raya.org" --name daed --license 'MIT AGPL' \
--package daed-linux-$GOARCH$GOAMD64$GOARM.$package_manager \
--after-install ../install/package_after_install.sh \
--before-remove ../install/package_before_remove.sh \
--after-remove ../install/package_after_remove.sh \
./geoip.dat=/usr/share/daed/geoip.dat ./geosite.dat=/usr/share/daed/geosite.dat \
./daed.service=/usr/lib/systemd/system/daed.service \
./${{ steps.get_filename.outputs.BUNDLE_NAME }}=/usr/bin/daed
Expand Down
8 changes: 8 additions & 0 deletions install/package_after_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

systemctl daemon-reload

if [ "$(systemctl is-active daed)" == 'active' ]; then
systemctl restart daed.service
echo "Restart daed service, it might take a while."
fi
3 changes: 3 additions & 0 deletions install/package_after_remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

systemctl daemon-reload
6 changes: 6 additions & 0 deletions install/package_before_remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

if [ "$(systemctl is-active daed)" == 'active' ]; then
systemctl stop daed.service
echo "stopped daed service, daed will be removed."
fi

0 comments on commit 383d5bd

Please sign in to comment.