Files
Daniel Norman 9a9a78b5a2 httpd: Build release archives in CI
- Add build/ci to build the archives of an annotated release tag
- Run it on the large_linux_arm Buildkite queue
- Keep the archives as artifacts and show checksums in an annotation
- Pass --load to docker, as a remote builder keeps the image in its cache
- Add build/fetch to download the archives of the CI release job
- Pick the job by its step key, so a failed test elsewhere does not hide it
- Add build/compare to check a build against another
- Document the CI build, the download and the comparison
2026-11-06 10:45:37 +01:00

46 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
set -e
# Builds the release archives in Buildkite, from a `releases/httpd/<version>`
# tag. garden-broker passes the tag name as BUILDKITE_BRANCH and the tag object
# as BUILDKITE_COMMIT; Buildkite sets no BUILDKITE_TAG.
tag="$BUILDKITE_BRANCH"
case "$tag" in
releases/httpd/*) ;;
*)
echo "fatal: '$tag' is not a releases/httpd/<version> tag" >&2
exit 1
;;
esac
# Reject a branch that only has the name of a release tag.
if [ "$(git cat-file -t "$BUILDKITE_COMMIT")" != tag ]; then
echo "fatal: $BUILDKITE_COMMIT is not an annotated tag" >&2
exit 1
fi
name="$(git cat-file tag "$BUILDKITE_COMMIT" | sed -n 's/^tag //p')"
if [ "$name" != "$tag" ]; then
echo "fatal: tag object $BUILDKITE_COMMIT is named '$name', not '$tag'" >&2
exit 1
fi
version="${tag#releases/httpd/}"
if ! echo "$version" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "fatal: '$version' is not a MAJOR.MINOR.PATCH version" >&2
exit 1
fi
export RADICLE_HTTPD_VERSION="$version"
CONTAINER=docker "$(dirname "$0")/build"
checksums="$("$(dirname "$0")/checksums" | sort -k2)"
buildkite-agent annotate --style info --context httpd-release <<EOF
radicle-httpd + radicle-search $version
\`\`\`
$checksums
\`\`\`
EOF