template / commit
Revert go.mod changes during release.
Makefile | 115 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/Makefile b/Makefile index be586c7..2ac9082 100644 --- a/Makefile +++ b/Makefile @@ -1,58 +1,59 @@ -.PHONY: test - -BINARY=template -VERSION=$(shell git describe --tags) -LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}" - -all: build test lint - -prep: - go mod tidy - -clean: - go clean - -build: prep - go build ${LDFLAGS} -o ${BINARY} . - -lint: build - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - golangci-lint --version - golangci-lint run --timeout=10m - -test: build - go test -v ./... -coverprofile="./test-coverage.out" - -test_coverage: test - go tool cover -html="./test-coverage.out" -o "./test-coverage.html" - -test_coverage_html: test_coverage - open "./test-coverage.html" - -install: build test lint - go install ${LDFLAGS} - template reset - -uninstall: - go clean -i gitlab.com/PavelSafronov/template... - if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi - -release-dry-run: build test lint - go install github.com/goreleaser/goreleaser@latest - goreleaser release --snapshot --rm-dist - -release-local: build test lint - go install github.com/goreleaser/goreleaser@latest - goreleaser build --single-target - -release: build test lint - go install github.com/goreleaser/goreleaser@latest - goreleaser release --clean - -brew-install: - brew tap PavelSafronov/template https://gitlab.com/PavelSafronov/template.git - brew install template - -brew-uninstall: - brew uninstall template +.PHONY: test + +BINARY=template +VERSION=$(shell git describe --tags) +LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}" + +all: build test lint + +prep: + go mod tidy + +clean: + go clean + +build: prep + go build ${LDFLAGS} -o ${BINARY} . + +lint: build + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint --version + golangci-lint run --timeout=10m + +test: build + go test -v ./... -coverprofile="./test-coverage.out" + +test_coverage: test + go tool cover -html="./test-coverage.out" -o "./test-coverage.html" + +test_coverage_html: test_coverage + open "./test-coverage.html" + +install: build test lint + go install ${LDFLAGS} + template reset + +uninstall: + go clean -i gitlab.com/PavelSafronov/template... + if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi + +release-dry-run: build test lint + go install github.com/goreleaser/goreleaser@latest + goreleaser release --snapshot --rm-dist + +release-local: build test lint + go install github.com/goreleaser/goreleaser@latest + goreleaser build --single-target + +release: build test lint + go install github.com/goreleaser/goreleaser@latest + git restore go.mod + goreleaser release --clean + +brew-install: + brew tap PavelSafronov/template https://gitlab.com/PavelSafronov/template.git + brew install template + +brew-uninstall: + brew uninstall template brew untap PavelSafronov/template \ No newline at end of file