github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/Makefile (about) 1 SOURCE_FILES?=./... 2 TEST_PATTERN?=. 3 TEST_OPTIONS?= 4 DOCKER?=docker 5 6 export PATH := ./bin:$(PATH) 7 export GO111MODULE := on 8 export GOPROXY = https://proxy.golang.org,direct 9 10 # Setup pre-commit hooks 11 dev: 12 cp -f scripts/pre-commit.sh .git/hooks/pre-commit 13 .PHONY: dev 14 15 # Install dependencies 16 setup: 17 go mod tidy 18 .PHONY: setup 19 20 # Run all the tests 21 test: 22 LC_ALL=C go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=5m 23 .PHONY: test 24 25 # Run all the tests and opens the coverage report 26 cover: test 27 go tool cover -html=coverage.txt 28 .PHONY: cover 29 30 # gofmt and goimports all go files 31 fmt: 32 gofumpt -w -l -s . 33 .PHONY: fmt 34 35 # Run all the tests and code checks 36 ci: build test 37 .PHONY: ci 38 39 # Build a beta version of goreleaser 40 build: 41 go build 42 .PHONY: build 43 44 imgs: 45 wget -O www/docs/static/logo.png https://github.com/goreleaser/artwork/raw/master/goreleaserfundo.png 46 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" 47 wget -O www/docs/static/avatar.png https://github.com/goreleaser.png 48 convert www/docs/static/avatar.png -define icon:auto-resize=64,48,32,16 docs/static/favicon.ico 49 convert www/docs/static/avatar.png -resize x120 www/docs/static/apple-touch-icon.png 50 .PHONY: imgs 51 52 serve: 53 $(DOCKER) run --rm -it -p 8000:8000 -v ${PWD}/www:/docs docker.io/squidfunk/mkdocs-material 54 .PHONY: serve 55 56 vercel: 57 yum install -y jq 58 pip install mkdocs-material mkdocs-minify-plugin lunr 59 ./scripts/get-releases.sh 60 (cd www && mkdocs build) 61 62 # Show to-do items per file. 63 todo: 64 @grep \ 65 --exclude-dir=vendor \ 66 --exclude-dir=node_modules \ 67 --exclude=Makefile \ 68 --text \ 69 --color \ 70 -nRo -E ' TODO:.*|SkipNow' . 71 .PHONY: todo 72 73 .DEFAULT_GOAL := build