feat(ci): autoupdate gitea
This commit is contained in:
parent
b0c824754f
commit
368cd75805
5
.util.sh
5
.util.sh
@ -5,6 +5,11 @@ update_github_tag() {
|
|||||||
echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
|
echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_gitea_tag() {
|
||||||
|
local ver=$(curl -Ls https://gitea.com/api/v1/repos/"$1"/releases/latest | jq -r '.name' | sed 's/^v//')
|
||||||
|
echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD
|
||||||
|
}
|
||||||
|
|
||||||
update_pkg() {
|
update_pkg() {
|
||||||
|
|
||||||
if [[ $(git diff . | wc -l) -ne 0 ]]; then
|
if [[ $(git diff . | wc -l) -ne 0 ]]; then
|
||||||
|
4
build.sh
4
build.sh
@ -56,6 +56,10 @@ for d in */; do
|
|||||||
if [[ -n "${repo}" ]]; then
|
if [[ -n "${repo}" ]]; then
|
||||||
update_github_tag "${repo}"
|
update_github_tag "${repo}"
|
||||||
fi
|
fi
|
||||||
|
repo=$(grep -oPm 1 'gitea\.com\/\K(\w|-)+\/(\w|-)+' .SRCINFO)
|
||||||
|
if [[ -n "${repo}" ]]; then
|
||||||
|
update_gitea_tag "${repo}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
update_pkg
|
update_pkg
|
||||||
build true
|
build true
|
||||||
|
Loading…
Reference in New Issue
Block a user