From 8c00e74df9d17902f5545506ff3ea591486e4e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 1 Sep 2021 09:38:13 +0300 Subject: [PATCH] Update release script - fix paths of sha256sum - check for old artifacts before doing the release --- Makefile | 3 +++ release | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f5c8038..5b3a089 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,9 @@ $(foreach goosarch,$(GOOSARCHS),\ .PHONY: all all: $(UNDOCKERS) sha256sum-$(VSN).txt +.PHONY: sha256sum-asc +sha256sum-asc: sha256sum-$(VSN).txt.asc + .PHONY: lint lint: go vet ./... diff --git a/release b/release index 5a750f4..af50667 100755 --- a/release +++ b/release @@ -9,7 +9,10 @@ err() { git status --porcelain | grep -q "" && err "working tree is dirty, commit your changes first." -[[ ! "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] && \ +[[ -f sha256sum-* ]] && + err "found artifacts from previous release, delete them first" + +[[ "$1" =~ ^v([0-9]+)\.([0-9]+)(\.([0-9]+))?$ ]] || \ err "arg1 accepts the following formats: v1.0 v1.0.0" git tag | grep -q "^$1$" && @@ -17,7 +20,7 @@ git tag | grep -q "^$1$" && last_tag=$(git tag | tail -1) -make -B -j"$(nproc)" VSN="$1" sha256sum.txt.asc +make -B -j"$(nproc)" VSN="$1" sha256sum-asc { echo undocker "$1" @@ -27,6 +30,6 @@ make -B -j"$(nproc)" VSN="$1" sha256sum.txt.asc echo echo echo sha256sums of released binaries: - cat sha256sum.txt + cat sha256sum-*.txt echo } | git tag -u motiejus@jakstys.lt -F - "$1"