-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 1.94 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
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
# See https://makefiletutorial.com for in depth examples
CURRENT_VERSION := $(shell cat VERSION)
NEXT_MAJOR_VERSION := $(shell sh scripts/semverinc.sh $(CURRENT_VERSION) 0)
NEXT_MINOR_VERSION := $(shell sh scripts/semverinc.sh $(CURRENT_VERSION) 1)
NEXT_PATCH_VERSION := $(shell sh scripts/semverinc.sh $(CURRENT_VERSION) 2)
build-timezone-data:
mkdir -p bin
go build -o bin/tz cmd/timezone/main.go
./bin/tz -build -db data/timezone.data
.PHONY: test
test:
go test ./...
test-verbose:
go test -v
code-coverage:
go test -cover -coverprofile coverage.out ./...
gocovsh
test-versioning:
@echo Sematic versioning test...
@echo ___Current version: v$(CURRENT_VERSION)
@echo Next patch version: v$(NEXT_PATCH_VERSION)
@echo Next minor version: v$(NEXT_MINOR_VERSION)
@echo Next major version: v$(NEXT_MAJOR_VERSION)
update: update_internal lint test-verbose
update_internal:
go get -u ./...
go mod tidy
lint:
golangci-lint run
create-next-major-version:
@echo Current Version: v$(CURRENT_VERSION)
@echo Next Major Version: v$(NEXT_MAJOR_VERSION)
@echo $(NEXT_MAJOR_VERSION) > VERSION
@git add .
@git commit -m "ARelease new major version: (v$(NEXT_MAJOR_VERSION))"
@git tag v$(NEXT_MAJOR_VERSION)
@echo In order to update tags run: git push --tags
create-next-minor-version:
@echo Current Version: v$(CURRENT_VERSION)
@echo Next Minor Version: v$(NEXT_MINOR_VERSION)
@echo $(NEXT_MINOR_VERSION) > VERSION
@git add .
@git commit -m "Release new minor version: (v$(NEXT_MINOR_VERSION))"
@git tag v$(NEXT_MINOR_VERSION)
@echo In order to update tags run: git push --tags
create-next-patch-version:
@echo Current Version: v$(CURRENT_VERSION)
@echo Next Patch Version: v$(NEXT_PATCH_VERSION)
@echo $(NEXT_PATCH_VERSION) > VERSION
@git add .
@git commit -m "Release new patch version: (v$(NEXT_PATCH_VERSION))"
@git tag v$(NEXT_PATCH_VERSION)
@echo In order to update tags run: git push --tags
#delete-all-tags:
# git tag -l | xargs git tag -d