-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.65 KB
/
Makefile
File metadata and controls
56 lines (45 loc) · 1.65 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
.PHONY: build build-windows build-linux dev clean frontend lint check tag release
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
# Default: build for current platform
build:
wails build -tags webkit2_41 -ldflags="-X main.Version=$(VERSION)"
# Windows .exe (run from Windows or WSL with wails in PATH)
build-windows:
GOOS=windows wails build -ldflags="-s -w -X main.Version=$(VERSION)"
# Linux binary (Ubuntu 24.04 needs webkit2_41 tag)
build-linux:
wails build -tags webkit2_41 -ldflags="-s -w -X main.Version=$(VERSION)"
# Development mode with hot reload
dev:
wails dev -tags webkit2_41
# Build frontend only
frontend:
cd frontend && npm run build
# Lint Go backend (install golangci-lint if missing)
lint:
@which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run ./...
# Run all checks (backend lint + frontend type check)
check: lint
cd frontend && npm run check
# Remove build output
clean:
rm -rf build/bin/*
# Auto-bump patch version, create tag, and push (triggers GitHub release workflow)
# Override with: make tag TAG=v2.0.0
TAG ?= $(shell latest=$$(git tag --sort=-v:refname | head -1 | sed 's/^v//'); \
major=$$(echo $$latest | cut -d. -f1); \
minor=$$(echo $$latest | cut -d. -f2); \
patch=$$(echo $$latest | cut -d. -f3); \
echo "v$$major.$$minor.$$((patch + 1))")
tag:
@echo "Tagging $(TAG)..."
git tag $(TAG)
git push origin $(TAG)
# Commit all changes and create a release tag
# Usage: make release m="your commit message"
# Override version: make release m="message" TAG=v2.0.0
release:
git add -A
git commit -m "$(m)"
$(MAKE) tag