From db806626d7f262f9eb4efdbc8fa145d51e0ebd23 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 26 Jul 2021 20:34:17 +0200 Subject: [PATCH] add auto update drone --- .util.sh | 18 ++++++++++++++++++ drone/update.sh | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 .util.sh create mode 100755 drone/update.sh diff --git a/.util.sh b/.util.sh new file mode 100644 index 0000000..95a7ac2 --- /dev/null +++ b/.util.sh @@ -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 + +} diff --git a/drone/update.sh b/drone/update.sh new file mode 100755 index 0000000..a464a90 --- /dev/null +++ b/drone/update.sh @@ -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