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
+1 -3
View File
@@ -32,9 +32,7 @@ or:
GITEA_RUNNER_VERSION=1.0.2 ./build.sh GITEA_RUNNER_VERSION=1.0.2 ./build.sh
``` ```
The script downloads the Linux `amd64` and `arm64` release artifacts, verifies their SHA256 checksums, builds `.deb` packages, moves them into `../gitea-runner-deb`, regenerates `Packages`, `Packages.gz`, and `Release`, then commits the release repo changes locally. The script downloads the Linux `amd64` and `arm64` release artifacts, verifies their SHA256 checksums, builds `.deb` packages, moves them into `../gitea-runner-deb`, regenerates `Packages`, `Packages.gz`, and `Release`, commits the release repo changes, then pushes the release repo branch to `origin`.
It does not push either repository.
## Systemd Timer ## Systemd Timer
+19
View File
@@ -6,6 +6,22 @@ BINARY_NAME="gitea-runner"
DOWNLOAD_NAME="gitea-runner" DOWNLOAD_NAME="gitea-runner"
RELEASE_REPO="../gitea-runner-deb" 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() { resolve_version() {
if [[ -n "${1:-}" ]]; then if [[ -n "${1:-}" ]]; then
VERSION_SOURCE="command line argument" 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 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." echo "SKIP: Version ${VERSION} already built and present in release repo."
publish_release_repo
exit 0 exit 0
fi fi
@@ -135,3 +152,5 @@ mv "${PACKAGE_NAME}_${VERSION}_"*.deb "${RELEASE_REPO}/"
echo "No changes to commit." echo "No changes to commit."
fi fi
) )
publish_release_repo