-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (65 loc) · 2.61 KB
/
Makefile
File metadata and controls
79 lines (65 loc) · 2.61 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# GitHub Command Center — Makefile
# Usage: make [target]
BINARY := github-command-center
VERSION := 2.0.0
GOFLAGS := -ldflags="-s -w -X main.Version=$(VERSION)"
.PHONY: all build build-frontend build-backend install uninstall clean docker docker-run dev lint help
## all: Build frontend + backend (default)
all: build
## build: Compile frontend and backend
build: build-frontend build-backend
## build-frontend: Compile React/TypeScript with Vite
build-frontend:
@echo "→ Building frontend..."
npm run build
## build-backend: Compile Go binary
build-backend:
@echo "→ Building backend..."
cd backend && go build $(GOFLAGS) -o ../$(BINARY) .
## install: Install binary + desktop launcher to local machine
install: build
@echo "→ Installing $(BINARY) to /usr/local/bin..."
sudo cp $(BINARY) /usr/local/bin/$(BINARY)
@echo "→ Installing desktop entry..."
sudo mkdir -p /usr/share/$(BINARY)
sudo cp -r dist/ /usr/share/$(BINARY)/dist
sudo cp -r public/ /usr/share/$(BINARY)/public
@echo "→ Creating systemd service..."
sudo cp debian-package/github-command-center.service /etc/systemd/system/ 2>/dev/null || true
@sudo bash -c 'cat > /usr/share/applications/github-command-center.desktop << EOF\n[Desktop Entry]\nName=GitHub Command Center\nComment=Self-hosted GitHub Desktop alternative\nExec=/usr/local/bin/github-command-center\nIcon=/usr/share/github-command-center/public/icon.png\nTerminal=false\nType=Application\nCategories=Development;VersionControl;\nEOF'
@echo "✓ Installation complete. Run: github-command-center"
## uninstall: Remove installation
uninstall:
sudo rm -f /usr/local/bin/$(BINARY)
sudo rm -rf /usr/share/$(BINARY)
sudo rm -f /usr/share/applications/github-command-center.desktop
sudo systemctl disable github-command-center 2>/dev/null || true
sudo rm -f /etc/systemd/system/github-command-center.service
@echo "✓ Uninstalled"
## clean: Remove build artifacts
clean:
rm -rf dist/ $(BINARY)
cd backend && go clean
## docker: Build Docker image
docker:
docker build -t github-command-center:$(VERSION) -t github-command-center:latest .
## docker-run: Run in Docker (binds to localhost:8765)
docker-run:
docker run --rm -p 8765:8765 \
-e GITHUB_TOKEN=$${GITHUB_TOKEN} \
-e GITHUB_USERNAME=$${GITHUB_USERNAME} \
github-command-center:latest
## dev: Start Vite dev server + Go backend concurrently
dev:
@echo "→ Starting development servers..."
@trap 'kill 0' INT; \
(cd backend && go run .) & \
npm run dev & \
wait
## lint: Run TypeScript + Go linters
lint:
npx tsc --noEmit
cd backend && go vet ./...
## help: Show this help
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /'