diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d01b68b --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | .PHONY: proto proto-lint proto-breaking test build clean | ||
| 2 | |||
| 3 | # Generate proto files | ||
| 4 | proto: | ||
| 5 | buf generate | ||
| 6 | |||
| 7 | # Lint proto files | ||
| 8 | proto-lint: | ||
| 9 | buf lint | ||
| 10 | |||
| 11 | # Check for breaking changes | ||
| 12 | proto-breaking: | ||
| 13 | buf breaking --against '.git#branch=main' | ||
| 14 | |||
| 15 | # Run tests | ||
| 16 | test: | ||
| 17 | go test ./... | ||
| 18 | |||
| 19 | # Build the relay | ||
| 20 | build: | ||
| 21 | go build -o bin/relay ./cmd/relay | ||
| 22 | |||
| 23 | # Clean generated files | ||
| 24 | clean: | ||
| 25 | rm -rf api/ | ||
| 26 | rm -f bin/relay | ||
| 27 | |||
| 28 | # Install buf (if not already installed) | ||
| 29 | install-buf: | ||
| 30 | @if ! command -v buf &> /dev/null; then \ | ||
| 31 | echo "Installing buf..."; \ | ||
| 32 | mkdir -p ~/.local/bin; \ | ||
| 33 | curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$$(uname -s)-$$(uname -m)" -o ~/.local/bin/buf; \ | ||
| 34 | chmod +x ~/.local/bin/buf; \ | ||
| 35 | echo "buf installed to ~/.local/bin/buf"; \ | ||
| 36 | echo "Make sure ~/.local/bin is in your PATH"; \ | ||
| 37 | else \ | ||
| 38 | echo "buf is already installed"; \ | ||
| 39 | fi | ||
