Update release script

- fix paths of sha256sum
- check for old artifacts before doing the release
This commit is contained in:
Motiejus Jakštys 2021-09-01 09:38:13 +03:00 committed by Motiejus Jakštys
parent 5e297827d3
commit 8c00e74df9
2 changed files with 9 additions and 3 deletions

View File

@ -26,6 +26,9 @@ $(foreach goosarch,$(GOOSARCHS),\
.PHONY: all .PHONY: all
all: $(UNDOCKERS) sha256sum-$(VSN).txt all: $(UNDOCKERS) sha256sum-$(VSN).txt
.PHONY: sha256sum-asc
sha256sum-asc: sha256sum-$(VSN).txt.asc
.PHONY: lint .PHONY: lint
lint: lint:
go vet ./... go vet ./...

View File

@ -9,7 +9,10 @@ err() {
git status --porcelain | grep -q "" && git status --porcelain | grep -q "" &&
err "working tree is dirty, commit your changes first." 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" err "arg1 accepts the following formats: v1.0 v1.0.0"
git tag | grep -q "^$1$" && git tag | grep -q "^$1$" &&
@ -17,7 +20,7 @@ git tag | grep -q "^$1$" &&
last_tag=$(git tag | tail -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" echo undocker "$1"
@ -27,6 +30,6 @@ make -B -j"$(nproc)" VSN="$1" sha256sum.txt.asc
echo echo
echo echo
echo sha256sums of released binaries: echo sha256sums of released binaries:
cat sha256sum.txt cat sha256sum-*.txt
echo echo
} | git tag -u motiejus@jakstys.lt -F - "$1" } | git tag -u motiejus@jakstys.lt -F - "$1"