2022-06-28 10:30:05 +02:00
|
|
|
#!/bin/bash
|
2021-07-26 20:34:17 +02:00
|
|
|
|
2021-07-26 20:37:40 +02:00
|
|
|
update_github_tag() {
|
2022-11-16 22:37:48 +01:00
|
|
|
local 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-)
|
2022-06-28 10:30:05 +02:00
|
|
|
echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
|
2021-07-26 20:37:40 +02:00
|
|
|
}
|
|
|
|
|
2021-07-26 20:34:17 +02:00
|
|
|
update_pkg() {
|
|
|
|
|
2022-06-28 10:30:05 +02:00
|
|
|
if [ $(git diff . | wc -l) -ne 0 ]; then
|
|
|
|
sed -i 's/pkgrel=.*/pkgrel=1/' PKGBUILD
|
2021-07-26 20:34:17 +02:00
|
|
|
|
2022-06-28 10:30:05 +02:00
|
|
|
if updpkgsums; then
|
|
|
|
makepkg --printsrcinfo >.SRCINFO
|
2022-11-16 22:37:48 +01:00
|
|
|
local ver=$(grep 'pkgver' .SRCINFO | cut -d'=' -f2 | tr -d ' ')
|
2021-07-26 20:34:17 +02:00
|
|
|
git add .SRCINFO PKGBUILD
|
2022-06-28 10:30:05 +02:00
|
|
|
if git commit -m "$(basename $(pwd)): update to ${ver} [CI SKIP]"; then
|
2022-11-16 22:07:36 +01:00
|
|
|
git push --set-upstream origin "${CI_COMMIT_BRANCH}"
|
2021-07-26 20:34:17 +02:00
|
|
|
fi
|
2022-06-28 10:30:05 +02:00
|
|
|
fi
|
2021-07-26 20:34:17 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
}
|