add auto update drone
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nyyu 2021-07-26 20:34:17 +02:00
parent 2870157c78
commit db806626d7
2 changed files with 27 additions and 0 deletions

18
.util.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
update_pkg() {
updpkgsums > /dev/null 2>&1
if [ $? -eq 0 ]
then
makepkg --printsrcinfo > .SRCINFO
git add .SRCINFO PKGBUILD
git commit -m "$(basename $(pwd)): update to $ver" > /dev/null 2>&1
if [ $? -eq 0 ]
then
git push
fi
fi
}

9
drone/update.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
source ../.util.sh
ver=`curl -s https://api.github.com/repos/drone/drone/tags | jq -r '.[0].name' | cut -c2-`
echo $ver
sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
update_pkg