forked from create-go-app/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (31 loc) · 1.11 KB
/
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
.PHONY: clean lint security critic test install build release build-and-push-images delete-tag update-pkg-cache
clean:
rm -rf ./tmp coverage.out
lint:
golangci-lint run ./...
security:
gosec -quiet ./...
critic:
gocritic check -enableAll ./...
test: clean lint security critic
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
install: test
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp ./cmd/cgapp/main.go
build: test
goreleaser --snapshot --skip-publish --rm-dist
release: test
git tag -a v$(VERSION) -m "v$(VERSION)"
goreleaser --snapshot --skip-publish --rm-dist
build-and-push-images: test
podman build -t docker.io/koddr/cgapp:latest .
podman push docker.io/koddr/cgapp:latest
podman build -t docker.io/koddr/cgapp:$(VERSION) .
podman push docker.io/koddr/cgapp:$(VERSION)
podman image rm docker.io/koddr/cgapp:$(VERSION)
update-pkg-cache:
curl -i https://proxy.golang.org/github.com/create-go-app/cli/v3/@v/v$(VERSION).info
delete-tag:
git tag --delete v$(VERSION)
podman image rm docker.io/koddr/cgapp:latest
podman image rm docker.io/koddr/cgapp:$(VERSION)