Push runner release repository after build
This commit is contained in:
@@ -32,9 +32,7 @@ or:
|
||||
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.
|
||||
|
||||
It does not push either repository.
|
||||
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`.
|
||||
|
||||
## Systemd Timer
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user