-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (29 loc) · 1015 Bytes
/
Makefile
File metadata and controls
35 lines (29 loc) · 1015 Bytes
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
# Makefile for automating release tasks
.PHONY: help update version commit
# Default command: Show help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " help Show this help message."
@echo " update Commit pending changes, bump the package version, and push (BUMP=patch|minor|major, default: patch)."
@echo " version Bump the package version only (BUMP=patch|minor|major, default: patch)."
@echo " commit Commit all pending changes (MSG=\"Your commit message\", default: \"chore: update files\")."
# Default version bump is 'patch'
BUMP ?= patch
# Default commit message
MSG ?= "chore: update files"
# Commit pending changes, bump the version, and push
update:
@if [ -n "$$(git status --porcelain)" ]; then \
$(MAKE) commit MSG="chore: pre-release commit"; \
fi
@$(MAKE) version
@git push --follow-tags
# Bump the package version
version:
@npm version $(BUMP) -m "chore(release): v%s"
# Commit all pending changes
commit:
@git add .
@git commit -m "$(MSG)"