-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (48 loc) · 1.78 KB
/
Makefile
File metadata and controls
56 lines (48 loc) · 1.78 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
GO_VERSION ?= 1.21
mod:
@read -p "Enter module name: " MODULE; \
mkdir -p $$MODULE; \
go -C $$MODULE mod init github.com/nativebpm/connectors/$$MODULE; \
go -C $$MODULE mod edit -go=$(GO_VERSION); \
echo "package $$MODULE" > $$MODULE/$$MODULE.go; \
go work use ./$$MODULE
tidy:
find . -name go.mod -execdir go mod tidy \;
go work sync
lint-install:
@if ! command -v golangci-lint >/dev/null 2>&1; then \
echo "Installing golangci-lint..."; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8; \
else \
echo "golangci-lint is already installed"; \
fi
lint: tidy lint-install
golangci-lint version
golangci-lint cache clean
find . -name go.mod -execdir golangci-lint run \;
test: lint
tag:
@read -p "Enter module name: " MODULE; \
echo ""; \
echo "Last 3 tags for $$MODULE:"; \
git for-each-ref --sort=-creatordate --format='%(refname:short) - %(contents:subject)' refs/tags | grep "^$$MODULE/" | head -n 3 || echo "No tags found"; \
echo ""; \
read -p "Enter version (vX.Y.Z): " VERSION; \
read -p "Enter message: " MESSAGE; \
TAG_NAME="$$MODULE/$$VERSION"; \
git tag -a "$$TAG_NAME" -m "$$VERSION ($$MESSAGE)"; \
git push --tags; \
echo "Tag $$TAG_NAME created and pushed"
tag-list:
@read -p "Enter module name: " MODULE; \
echo ""; \
echo "Tags for $$MODULE:"; \
git for-each-ref --sort=-creatordate --format='%(refname:short) - %(contents:subject)' refs/tags | grep "^$$MODULE/" || echo "No tags found"; \
echo ""
tag-del:
@read -p "Enter module name: " MODULE; \
read -p "Enter version to delete (vX.Y.Z): " VERSION; \
TAG_NAME="$$MODULE/$$VERSION"; \
git tag -d "$$TAG_NAME" || echo "Tag $$TAG_NAME not found locally"; \
git push --delete origin "$$TAG_NAME" || echo "Tag $$TAG_NAME not found on remote"; \
echo "Tag $$TAG_NAME deleted if it existed"