-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (41 loc) · 1.12 KB
/
Makefile
File metadata and controls
46 lines (41 loc) · 1.12 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
SHELL := /bin/bash
.PHONY: setup
setup: install test build
.PHONY: install
install:
@echo "Installing dependencies..."
@npm install
.PHONY: build
build:
@echo "Building..."
@npm run build
.PHONY: test
test:
@echo "Running tests..."
@npx jest --clearCache
@npx jest --no-coverage
.PHONY: release
release:
@if [ -z "$(VERSION)" ]; then \
echo "Error: VERSION is required. Usage: make release VERSION=5.3.4"; \
exit 1; \
fi
@TAG=$(VERSION); \
if [[ ! $$TAG =~ ^v ]]; then \
TAG="v$$TAG"; \
fi; \
echo "Tagging release $$TAG..."; \
git tag $$TAG; \
git push origin $$TAG; \
MAJOR=$$(echo $$TAG | grep -oE '^v[0-9]+'); \
echo "Updating major version tag $$MAJOR..."; \
git tag -d $$MAJOR 2>/dev/null || true; \
git tag $$MAJOR; \
git push origin $$MAJOR --force; \
if command -v gh >/dev/null 2>&1; then \
echo "Creating GitHub release for $$TAG..."; \
gh release create $$TAG --title "$$TAG" --generate-notes || echo "⚠ Failed to create GitHub release (may already exist)"; \
else \
echo "⚠ GitHub CLI (gh) not installed, skipping release creation"; \
fi; \
echo "✓ Released $$TAG and updated $$MAJOR"