-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (35 loc) · 977 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
44
45
46
47
VERSION ?= `git vertag get`
COMMIT ?= `git rev-parse HEAD`
DATE ?= `date --iso-8601`
generate-clear: gen-clear
.PHONY: generate-clear
gen-clear:
rm -rf ./**/*_gen.go
.PHONY: gen-clear
generate: gen
.PHONY: generate
gen: gen-clear
go generate -x ./...
.PHONY: gen
clear-sdl:
rm -f ./internal/githubv4/schema.graphql
.PHONY: clear-sdl
get-sdl:
curl -Lo ./internal/githubv4/schema.graphql https://docs.github.com/public/fpt/schema.docs.graphql
.PHONY: get-sdl
gen-gql: clear-sdl get-sdl
go generate -tags gengraphql -x ./internal/githubv4
.PHONY: gen-gql
lint: gen
golangci-lint run
.PHONY: lint
test: gen
go test -tags man -v --race ./...
.PHONY: test
man: gen
rm -rf ./usage/**.md
go run -tags man -ldflags "-X=main.version=$(VERSION) -X=main.commit=$(COMMIT) -X=main.date=$(DATE)" ./cmd/gogh man
.PHONY: man
install: test
go install -a -ldflags "-X=main.version=$(VERSION) -X=main.commit=$(COMMIT) -X=main.date=$(DATE)" ./cmd/gogh/...
.PHONY: install