-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 1.72 KB
/
Makefile
File metadata and controls
49 lines (37 loc) · 1.72 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
.PHONY: build build-linux-amd64 build-linux-arm64 test test-integration benchmark integration-test clean release icns app
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
build:
go build -ldflags="-X main.version=$(VERSION)" -o zee
build-linux-amd64:
GOOS=linux GOARCH=amd64 go build -ldflags="-X main.version=$(VERSION) -s -w" -o zee-linux-amd64
build-linux-arm64:
GOOS=linux GOARCH=arm64 go build -ldflags="-X main.version=$(VERSION) -s -w" -o zee-linux-arm64
test:
go test -race -v ./...
integration-test:
@test -n "$(WAV)" || (echo "Usage: make integration-test WAV=file.wav" && exit 1)
@if [ -f .env ]; then export $$(grep -v '^#' .env | xargs); fi; \
test -n "$$GROQ_API_KEY" || (echo "Error: GROQ_API_KEY not set (create .env or export it)" && exit 1); \
go run test/integration_test.go $(WAV)
benchmark: build
@test -n "$(WAV)" || (echo "Usage: make benchmark WAV=file.wav [RUNS=5]" && exit 1)
@if [ -f .env ]; then export $$(grep -v '^#' .env | xargs); fi; \
./zee -benchmark $(WAV) -runs $(or $(RUNS),3)
test-integration:
@tmp=$$(mktemp -d) && \
go build -o "$$tmp/zee-test-bin" . && \
ZEE_TEST_BIN="$$tmp/zee-test-bin" go test -race -tags integration -v -timeout 120s -count=1 ./test/ ; \
status=$$? ; rm -rf "$$tmp" ; exit $$status
icns:
packaging/mkicns.sh packaging/appicon.png
app: build icns
packaging/mkdmg.sh zee $(VERSION) Zee-$(VERSION).dmg
clean:
rm -f zee Zee-*.dmg
release:
@latest=$$(gh release view --json tagName -q .tagName 2>/dev/null || echo "none"); \
echo "latest release: $$latest"; \
read -p "new version (e.g. 0.2.0): " ver; \
test -n "$$ver" || (echo "aborted" && exit 1); \
echo "tagging v$$ver and pushing..."; \
git tag "v$$ver" && git push origin "v$$ver"