From 69c5c28d0a9d166b7d9e1fc291a98f2ebbf1d02c Mon Sep 17 00:00:00 2001 From: Oli Date: Tue, 21 Oct 2025 10:38:34 +0200 Subject: [PATCH] make+release.sh: add release helper script for docker --- Makefile | 4 ++++ release.sh | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 414039c..491d427 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/release.sh b/release.sh index 0ddaf6a..20a0504 100755 --- a/release.sh +++ b/release.sh @@ -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: +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