-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.mk
More file actions
63 lines (54 loc) · 1.8 KB
/
Copy pathrelease.mk
File metadata and controls
63 lines (54 loc) · 1.8 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
# Release Management Makefile
VERSION = 1.0.0
.PHONY: release
release: check-clean create-tag push-tag
.PHONY: check-clean
check-clean:
@echo "Checking working directory status..."
@if [ -n "$$(git status --porcelain)" ]; then \
echo "ERROR: Working directory has uncommitted changes"; \
git status --short; \
exit 1; \
fi
@echo "Working directory is clean"
.PHONY: create-tag
create-tag:
@echo "Creating tag v$(VERSION)..."
@git tag -a v$(VERSION) -m "Release v$(VERSION)"
@echo "Tag created successfully"
.PHONY: push-tag
push-tag:
@echo "Pushing tag to remote repository..."
@git push origin v$(VERSION)
@echo "Tag pushed, GitHub Action will build release"
.PHONY: retag
retag: delete-tag create-tag force-push-tag
.PHONY: delete-tag
delete-tag:
@echo "Deleting local and remote tag v$(VERSION)..."
@git tag -d v$(VERSION) 2>/dev/null || true
@git push --delete origin v$(VERSION) 2>/dev/null || true
@echo "Tag deleted"
.PHONY: force-push-tag
force-push-tag:
@echo "Force pushing new tag..."
@git push origin v$(VERSION)
@echo "Tag re-pushed successfully"
.PHONY: release-info
release-info:
@echo "Release Information:"
@echo " Version: v$(VERSION)"
@echo " Current branch: $$(git branch --show-current)"
@echo " Latest commit: $$(git log -1 --oneline)"
@echo " Tag status: $$(git tag -l v$(VERSION) | grep -q v$(VERSION) && echo 'exists' || echo 'not found')"
.PHONY: help-release
help-release:
@echo "Release Commands:"
@echo " make release - Create and push new version tag"
@echo " make retag - Delete old tag and recreate"
@echo " make release-info - Show current release information"
@echo ""
@echo "Notes:"
@echo " - Working directory must be clean"
@echo " - Pushing tag triggers GitHub Action build"
@echo " - Version is set in VERSION variable at top of Makefile"