github.com/joselitofilho/goreleaser@v0.155.1-0.20210123221854-e4891856c593/Makefile (about) 1 SOURCE_FILES?=./... 2 TEST_PATTERN?=. 3 TEST_OPTIONS?= 4 5 export PATH := ./bin:$(PATH) 6 export GO111MODULE := on 7 export GOPROXY = https://proxy.golang.org,direct 8 9 # Install all the build and lint dependencies 10 setup: 11 go mod download 12 go generate -v ./... 13 .PHONY: setup 14 15 # Run all the tests 16 test: 17 LC_ALL=C go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=5m 18 .PHONY: test 19 20 # Run all the tests and opens the coverage report 21 cover: test 22 go tool cover -html=coverage.txt 23 .PHONY: cover 24 25 # gofmt and goimports all go files 26 fmt: 27 find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done 28 .PHONY: fmt 29 30 # Run all the linters 31 lint: 32 golangci-lint run ./... 33 misspell -error **/* 34 .PHONY: lint 35 36 # Run all the tests and code checks 37 ci: build test lint 38 .PHONY: ci 39 40 # Build a beta version of goreleaser 41 build: 42 go build 43 .PHONY: build 44 45 imgs: 46 wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png 47 wget -O www/docs/static/card.png "https://og.caarlos0.dev/**GoReleaser**%20%7C%20Deliver%20Go%20binaries%20as%20fast%20and%20easily%20as%20possible.png?theme=light&md=1&fontSize=80px&images=https://github.com/goreleaser.png" 48 wget -O www/docs/static/avatar.png https://github.com/goreleaser.png 49 convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 docs/static/favicon.ico 50 convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png 51 .PHONY: imgs 52 53 serve: 54 @docker run --rm -it -p 8000:8000 -v ${PWD}/www:/docs squidfunk/mkdocs-material 55 .PHONY: serve 56 57 vercel: 58 yum install -y jq 59 pip install mkdocs-material mkdocs-minify-plugin 60 ./scripts/get-releases.sh 61 (cd www && mkdocs build) 62 63 # Show to-do items per file. 64 todo: 65 @grep \ 66 --exclude-dir=vendor \ 67 --exclude-dir=node_modules \ 68 --exclude=Makefile \ 69 --text \ 70 --color \ 71 -nRo -E ' TODO:.*|SkipNow' . 72 .PHONY: todo 73 74 .DEFAULT_GOAL := build