♻ (autoupdate) Move auto update git code to autoupdate.sh

This commit is contained in:
Marcel Kapfer 2023-07-26 19:33:15 +02:00
parent d02cedc381
commit 9293768ee2
2 changed files with 11 additions and 24 deletions

View file

@ -18,3 +18,13 @@ new_version="$(echo "$check" | xmllint --xpath 'string(/dehs/upstream-version)'
popd popd
./update-new-version.sh --autoupdate "$new_version" ./update-new-version.sh --autoupdate "$new_version"
git add -A
git commit -m "Upstream version $new_version"
git switch main
git merge --ff-only version-"$new_version"
git push origin main
git tag -a v"$new_version" -m "Upstream version $new_version"
git push --tags origin main

View file

@ -1,8 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# This script intends to decrease the effort of updating the package. # This script intends to decrease the effort of updating the package.
#
# Passing "--autoupdate" as first argument triggers automatic Git operations.
set -euo pipefail set -euo pipefail
@ -18,14 +16,7 @@ DISTRIBUTION="lunar"
last_tag=$(git describe --abbrev=0 --tags) last_tag=$(git describe --abbrev=0 --tags)
old="${last_tag#?}" old="${last_tag#?}"
if [ "$1" = "--autoupdate" ]; then
new="$2"
autoupdate="y"
else
new="$1" new="$1"
autoupdate="n"
fi
name="$(git config --get user.name)" name="$(git config --get user.name)"
email="$(git config --get user.email)" email="$(git config --get user.email)"
@ -51,17 +42,3 @@ debuild -us -uc
cd .. cd ..
rm "$PACKAGE"_"$old"-* rm "$PACKAGE"_"$old"-*
if [ "$autoupdate" = "n" ]; then
exit
fi
git add -A
git commit -m "Upstream version $new"
git switch main
git merge --ff-only version-"$new"
git push origin main
git tag -a v"$new" -m "Upstream version $new"
git push --tags origin main