aur/.util.sh
nyyu 7b3e031bc2
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: woodpecker ci
2022-11-16 22:07:36 +01:00

23 lines
665 B
Bash

#!/bin/bash
update_github_tag() {
ver=$(curl -Ls https://api.github.com/repos/"$1"/tags | jq -r '[.[] | select(.name | index("rc") | not) | select (.name | index("dev") | not)] | first | .name' | cut -c2-)
echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
}
update_pkg() {
if [ $(git diff . | wc -l) -ne 0 ]; then
sed -i 's/pkgrel=.*/pkgrel=1/' PKGBUILD
if updpkgsums; then
makepkg --printsrcinfo >.SRCINFO
git add .SRCINFO PKGBUILD
if git commit -m "$(basename $(pwd)): update to ${ver} [CI SKIP]"; then
git push --set-upstream origin "${CI_COMMIT_BRANCH}"
fi
fi
fi
}