forked from ChrisWiegman/kana
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (69 loc) · 1.66 KB
/
Makefile
File metadata and controls
77 lines (69 loc) · 1.66 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PKG := github.com/ChrisWiegman/kana-cli
VERSION := $(shell git describe --tags || echo "0.0.1")
GITHASH := $(shell git describe --tags --always --dirty)
TIMESTAMP := $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
%:
@:
.PHONY: build
build:
go mod vendor
go run ./scripts/generateTemplateConstants.go
go install \
-ldflags "-s -w -X $(PKG)/internal/cmd.Version=$(VERSION) -X $(PKG)/internal/cmd.GitHash=$(GITHASH) -X $(PKG)/internal/cmd.Timestamp=$(TIMESTAMP)" \
./cmd/...
.PHONY: change
change:
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
new
.PHONY: changelog
changelog:
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
batch $(call ARGS,defaultstring)
docker run \
--rm \
--platform linux/amd64 \
--mount type=bind,source=$(PWD),target=/src \
-w /src \
-it \
ghcr.io/miniscruff/changie \
merge
.PHONY: clean
clean:
rm -rf \
dist \
vendor
.PHONY: install
install:
go mod vendor
go run ./scripts/generateTemplateConstants.go
go install \
-ldflags "-s -w -X $(PKG)/internal/cmd.Version=$(VERSION) -X $(PKG)/internal/cmd.GitHash=$(GITHASH) -X $(PKG)/internal/cmd.Timestamp=$(TIMESTAMP)" \
./cmd/...
.PHONY: update
update:
go get -u ./...
.PHONY: release
release:
echo $(VERSION)
docker run --rm \
--privileged \
-v $(PWD):/go/src/$(PKG) \
-w /go/src/$(PKG) \
goreleaser/goreleaser \
release \
--rm-dist \
--release-notes=./.changes/$(VERSION).md \
--snapshot