-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.6 KB
/
Makefile
File metadata and controls
55 lines (43 loc) · 1.6 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
.PHONY: help version tag-patch tag-minor tag-major test generate-icons
help:
@echo "Available targets:"
@echo " version - Show current version"
@echo " generate-icons - Regenerate Material Symbol icon constants"
@echo " test - Run tests"
@echo " tag-patch - Increment patch version (v0.0.X -> v0.0.X+1)"
@echo " tag-minor - Increment minor version (v0.X.0 -> v0.X+1.0)"
@echo " tag-major - Increment major version (vX.0.0 -> vX+1.0.0)"
# Get the latest tag (globally) or default to v0.0.0
LATEST_TAG := $(shell git tag -l | sort -V | tail -n 1)
CURRENT_TAG := $(if $(LATEST_TAG),$(LATEST_TAG),v0.0.0)
# Parse current version
MAJOR := $(shell echo $(CURRENT_TAG) | awk -F. '{print $$1}' | sed 's/v//')
MINOR := $(shell echo $(CURRENT_TAG) | awk -F. '{print $$2}')
PATCH := $(shell echo $(CURRENT_TAG) | awk -F. '{print $$3}')
version:
@echo "Current version: $(CURRENT_TAG)"
tag-patch:
@echo "Current version: $(CURRENT_TAG)"
@new_patch=$$(($(PATCH) + 1)); \
NEW_TAG="v$(MAJOR).$(MINOR).$$new_patch"; \
echo "New version: $$NEW_TAG"; \
git tag $$NEW_TAG; \
echo "Created tag $$NEW_TAG"
tag-minor:
@echo "Current version: $(CURRENT_TAG)"
@new_minor=$$(($(MINOR) + 1)); \
NEW_TAG="v$(MAJOR).$$new_minor.0"; \
echo "New version: $$NEW_TAG"; \
git tag $$NEW_TAG; \
echo "Created tag $$NEW_TAG"
tag-major:
@echo "Current version: $(CURRENT_TAG)"
@new_major=$$(($(MAJOR) + 1)); \
NEW_TAG="v$$new_major.0.0"; \
echo "New version: $$NEW_TAG"; \
git tag $$NEW_TAG; \
echo "Created tag $$NEW_TAG"
generate-icons:
go generate ./compose/material3/icon/...
test:
go test ./...