Push runner release repository after build

This commit is contained in:
2026-05-14 19:50:01 +02:00
parent 6ca99d206b
commit f1ab8059b0
2 changed files with 20 additions and 3 deletions
+19
View File
@@ -6,6 +6,22 @@ BINARY_NAME="gitea-runner"
DOWNLOAD_NAME="gitea-runner"
RELEASE_REPO="../gitea-runner-deb"
publish_release_repo() {
(
cd "${RELEASE_REPO}"
local branch
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$branch" == "HEAD" ]]; then
echo "Release repo is in detached HEAD state; cannot push automatically." >&2
exit 1
fi
echo "Pushing release repo ${branch} ..."
git push origin "${branch}"
)
}
resolve_version() {
if [[ -n "${1:-}" ]]; then
VERSION_SOURCE="command line argument"
@@ -66,6 +82,7 @@ done
if [[ -f "${RELEASE_REPO}/${PACKAGE_NAME}_${VERSION}_amd64.deb" ]] && [[ -f "${RELEASE_REPO}/${PACKAGE_NAME}_${VERSION}_arm64.deb" ]]; then
echo "SKIP: Version ${VERSION} already built and present in release repo."
publish_release_repo
exit 0
fi
@@ -135,3 +152,5 @@ mv "${PACKAGE_NAME}_${VERSION}_"*.deb "${RELEASE_REPO}/"
echo "No changes to commit."
fi
)
publish_release_repo