summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 35ea9f779137e6b6ade3f1a4e191072739e59aab (plain)
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
.PHONY: proto proto-lint proto-breaking test build clean deploy

# Generate proto files
proto:
	buf generate

# Lint proto files
proto-lint:
	buf lint

# Check for breaking changes
proto-breaking:
	buf breaking --against '.git#branch=main'

# Run tests
test:
	go test ./...

# Build the relay
build:
	go build -o bin/relay ./cmd/relay

# Build test client
build-client:
	go build -o bin/testclient ./cmd/testclient

# Build everything
build-all: build build-client

# Clean generated files
clean:
	rm -rf api/
	rm -f bin/relay

deploy:
	ship --name nostr-grpc --binary ./bin/relay

# Install buf (if not already installed)
install-buf:
	@if ! command -v buf &> /dev/null; then \
		echo "Installing buf..."; \
		mkdir -p ~/.local/bin; \
		curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$$(uname -s)-$$(uname -m)" -o ~/.local/bin/buf; \
		chmod +x ~/.local/bin/buf; \
		echo "buf installed to ~/.local/bin/buf"; \
		echo "Make sure ~/.local/bin is in your PATH"; \
	else \
		echo "buf is already installed"; \
	fi