Converted pre-push hook into a make target, avoid calling tests twice when releasing

This commit is contained in:
Deluan 2020-09-24 17:23:46 -04:00
parent 27adb84177
commit a99924ea20
2 changed files with 10 additions and 8 deletions

View File

@ -86,13 +86,20 @@ buildall: check_env
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=$(GIT_TAG)-SNAPSHOT" -tags=embed
.PHONY: buildall
pre-push:
golangci-lint run -v
@echo
make test
.PHONY: pre-push
release:
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
go mod tidy
@if [ -n "`git status -s`" ]; then echo "\n\nThere are pending changes. Please commit or stash first"; exit 1; fi
make test
make pre-push
git tag v${V}
git push origin v${V}
git push origin v${V} --no-verify
.PHONY: release
snapshot:

View File

@ -1,9 +1,4 @@
#!/bin/sh
set -e
echo "#### Linting"
golangci-lint run -v
echo
echo "#### Running tests"
make test
make pre-push