forked from ekalinin/github-markdown-toc.go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 1006 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
EXEC=gh-md-toc
CMD_SRC=cmd/${EXEC}/main.go
BUILD_DIR=build
BUILD_OS="windows darwin linux"
BUILD_ARCH="amd64"
E2E_DIR=e2e-tests
E2E_RUN=go run cmd/gh-md-toc/main.go ./README.md
clean:
@rm -f ${EXEC}
@rm -f ${BUILD_DIR}/*
@go clean
lint:
@go vet
@golangci-lint run
# make run ARGS="--help"
run:
@go run ${CMD_SRC} $(ARGS)
build: clean lint
go build -race -o ${EXEC} ${CMD_SRC}
test: clean lint
@go test -cover -o ${EXEC}
e2e:
echo " >> Local MD & options ..."
${E2E_RUN} > ${E2E_DIR}/got.md
diff ${E2E_DIR}/want.md ${E2E_DIR}/got.md
${E2E_RUN} --hide-header --hide-footer --depth=1 --no-escape > ${E2E_DIR}/got2.md
diff ${E2E_DIR}/want2.md ${E2E_DIR}/got2.md
${E2E_RUN} --hide-header --hide-footer --indent=4 > ${E2E_DIR}/got3.md
diff ${E2E_DIR}/want3.md ${E2E_DIR}/got3.md
release: test
@git tag v`grep "\tVersion" internal/version.go | grep -o -E '[0-9]\.[0-9]\.[0-9]{1,2}'`
@git push --tags origin master
release-local:
@goreleaser check
@goreleaser release --snapshot --clean