make+release.sh: add release helper script for docker

This commit is contained in:
Oli 2025-10-21 10:38:34 +02:00
parent 0f09a63b90
commit 69c5c28d0a
No known key found for this signature in database
GPG key ID: 8E4256593F177720
2 changed files with 16 additions and 0 deletions

View file

@ -81,6 +81,10 @@ release:
rm -rf chantools-v*
./release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(RELEASE_LDFLAGS)"
docker-release:
@$(call print, "Creating docker release of chantools.")
./release.sh docker-release "$(VERSION_TAG)"
docker-tools:
@$(call print, "Building tools docker image.")
docker build -q -t chantools-tools $(TOOLS_DIR)

View file

@ -10,6 +10,7 @@
set -e
PKG="github.com/lightninglabs/chantools"
DOCKER_USER="guggero"
PACKAGE=chantools
# green prints one line of green text (if the terminal supports it).
@ -79,6 +80,13 @@ function build_release() {
shasum -a 256 * >manifest-$tag.txt
}
# docker_release builds the Docker images for all supported platforms.
# arguments: <version-tag>
function docker_release() {
local tag=$1
docker buildx build --platform linux/arm64,linux/amd64 --tag $DOCKER_USER/$PACKAGE:$tag --output "type=registry" .
}
# usage prints the usage of the whole script.
function usage() {
red "Usage: "
@ -103,6 +111,10 @@ build-release)
green "Building release"
build_release "$@"
;;
docker-release)
green "Building docker release"
docker_release "$@"
;;
*)
usage
exit 1