template / commit
Moving some one-time actions out of the daily path.
.gitlab-ci.yml | 2 ++ Makefile | 26 ++++++++++---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c600625..1ae020b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ build-job: - .shared_windows_runners stage: build-and-test script: + - make dev-prep - make all release: @@ -52,4 +53,5 @@ release: # - tags script: + - make dev-prep - make release \ No newline at end of file diff --git a/Makefile b/Makefile index c9067f7..d9b3cb7 100644 --- a/Makefile +++ b/Makefile @@ -6,18 +6,20 @@ LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}" all: build test lint -prep: - go mod tidy +dev-prep: + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint --version + go install github.com/goreleaser/goreleaser@latest + goreleaser --version clean: go clean + go mod tidy -build: prep +build: 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 @@ -29,24 +31,16 @@ test_coverage: test 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-local-no-build: goreleaser build --single-target release: build test lint - go install github.com/goreleaser/goreleaser@latest git restore go.mod goreleaser release --clean