@@ -2,53 +2,25 @@ VERSION ?= 0.0.0-dev
22
33.PHONY : clean
44clean :
5- rm -rf bin/
65 rm -rf release/
76 rm -rf dist/
87
98.PHONY : lint
10- lint : golangci-lint # # Run golang-ci-lint against code.
11- $(GOLANGCI_LINT ) run ./...
9+ lint : # # Run golang-ci-lint against code.
10+ go tool golangci-lint run ./...
11+
12+ .PHONY : lint-fix
13+ lint-fix : # # Run golang-ci-lint against code and apply fixes.
14+ go tool golangci-lint run --fix ./...
1215
1316# # Location to create the release
1417RELEASE_DIR ?= $(shell pwd) /release
1518$(RELEASE_DIR ) :
1619 mkdir -p $(RELEASE_DIR )
1720
1821.PHONY : release
19- release : gox gomplate $(RELEASE_DIR ) # # Run release artifacts
20- CGO_ENABLED=0 $( GOX ) -output=" dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -os=" linux darwin windows" -arch=" amd64 arm64"
21- VERSION=$(VERSION ) $( GOMPLATE ) -f hack/provider.yaml.tpl > $(RELEASE_DIR ) /provider.yaml
22+ release : $(RELEASE_DIR ) # # Run release artifacts
23+ CGO_ENABLED=0 go tool gox -output=" dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -os=" linux darwin windows" -arch=" amd64 arm64"
24+ VERSION=$(VERSION ) go tool gomplate -f hack/provider.yaml.tpl > $(RELEASE_DIR ) /provider.yaml
2225 mv dist/* $(RELEASE_DIR )
23- rm -rf dist/
24-
25- # # Location to install dependencies to
26- LOCALBIN ?= $(shell pwd) /bin
27- $(LOCALBIN ) :
28- mkdir -p $(LOCALBIN )
29-
30- # # Tool Binaries
31- GOX ?= $(LOCALBIN ) /gox
32- GOMPLATE ?= $(LOCALBIN ) /gomplate
33- GOLANGCI_LINT ?= $(LOCALBIN ) /golangci-lint
34-
35- # # Tool Versions
36- GOX_VERSION ?= latest
37- GOMPLATE_VERSION ?= v4.3.1
38- GOLANGCI_LINT_VERSION ?= v1.64.7
39-
40- .PHONY : gox
41- gox : $(GOX )
42- $(GOX ) : $(LOCALBIN )
43- GOBIN=$(LOCALBIN ) go install github.com/mitchellh/gox@$(GOX_VERSION )
44-
45- .PHONY : gomplate
46- gomplate : $(GOMPLATE )
47- $(GOMPLATE ) : $(LOCALBIN )
48- GOBIN=$(LOCALBIN ) go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@$(GOMPLATE_VERSION )
49-
50- .PHONY : golangci-lint
51- golangci-lint : $(GOLANGCI_LINT )
52- $(GOLANGCI_LINT ) : $(GOLANGCI_LINT )
53- test -s $(LOCALBIN ) /golangci-lint && $(LOCALBIN ) /golangci-lint version | grep -q $(GOLANGCI_LINT_VERSION ) || \
54- GOBIN=$(LOCALBIN ) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION )
26+ rm -rf dist/
0 commit comments