-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 1.08 KB
/
Makefile
File metadata and controls
40 lines (31 loc) · 1.08 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
.PHONY: build install clean test list release-dry-run install-deps vhs
VERSION := $(shell git describe --tags 2>/dev/null || echo "dev")
LDFLAGS := -ldflags "-X main.version=$(VERSION)"
# Display available tasks
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
# Build the application
build:
go build $(LDFLAGS)
# Install the application
install:
go install $(LDFLAGS)
# Clean the build
clean:
@rm -f tiny-timer
go clean -testcache
# Run tests
test:
@echo "Running tests..."
go test ./...
# Install development dependencies
install-deps:
@echo "Installing development dependencies..."
@go install github.com/goreleaser/goreleaser@latest
@echo "Dependencies installed successfully!"
# Test release process with GoReleaser (dry-run)
release-dry-run:
@echo "Running GoReleaser dry-run..."
goreleaser release --snapshot --skip-publish --clean
vhs: build
docker run --rm -v $(PWD):/vhs ghcr.io/charmbracelet/vhs vhs/basic.tape