build: add `release` and `dist` targets

This commit is contained in:
Deluan 2020-01-30 16:33:27 -05:00
parent 9b7d1757e7
commit 0c5bf18d80
1 changed files with 14 additions and 0 deletions

View File

@ -72,3 +72,17 @@ build: check_go_env
.PHONY: buildall
buildall: check_env assets/embedded_gen.go
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master" -tags=embed
.PHONY: release
release:
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
go mod tidy
make test
@if [ -n "`git status -s`" ]; then echo "\n\nThere are pending changes. Please commit or stash first"; exit 1; fi
git tag v${V}
git push origin v${V}
git push origin master
.PHONY: dist
dist:
docker run -it -v $(PWD):/github/workspace -w /github/workspace bepsays/ci-goreleaser:1.13-4 goreleaser release --rm-dist --skip-publish --snapshot