-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (60 loc) · 1.67 KB
/
Makefile
File metadata and controls
73 lines (60 loc) · 1.67 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
# Anton Ustinoff <a.a.ustinoff@gmail.com>, 31 August 2024
SHELL :=/bin/bash -e -o pipefail
PWD := $(shell pwd)
# TAG, e.g: v1.0.0
TAG=$(shell git describe --tags --abbrev=0 | awk -F. '{$$NF = $$NF + 1;} 1' OFS=.)
.PHONY: help
help:
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: setup
setup: ## setup environment
@npm install
@npm install -g @vscode/vsce
.PHONY: login
login: ## login to vsce
@vsce login ziqq
.PHONY: build
build: setup ## build extension
@vsce package
.PHONY: tag-add
tag-add: ## Make command to add TAG. E.g: make tag-add TAG=v1.0.0
@if [ -z "$(TAG)" ]; then echo "TAG is not set"; exit 1; fi
@echo ""
@echo "START ADDING TAG: $(TAG)"
@echo ""
@git tag $(TAG)
@git push origin $(TAG)
@echo ""
@echo "CREATED AND PUSHED TAG $(TAG)"
@echo ""
.PHONY: tag-remove
tag-remove: ## Make command to delete TAG. E.g: make tag-delete TAG=v1.0.0
@if [ -z "$(TAG)" ]; then echo "TAG is not set"; exit 1; fi
@echo ""
@echo "START REMOVING TAG: $(TAG)"
@echo ""
@git tag -d $(TAG)
@git push origin --delete $(TAG)
@echo ""
@echo "DELETED TAG $(TAG) LOCALLY AND REMOTELY"
@echo ""
.PHONY: publish
publish: build ## publish extension
@vsce publish
.PHONY: minor
minor: build ## publish minor TAG
@vsce publish minor
.PHONY: test
test: ## run tests
@npm install
@npm test
.PHONY: diff
diff: ## git diff
$(call print-target)
@git diff --exit-code
@RES=$$(git status --porcelain) ; if [ -n "$$RES" ]; then echo $$RES && exit 1 ; fi
define print-target
@printf "Executing target: \033[36m$@\033[0m\n"
endef