-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (50 loc) · 1.69 KB
/
Makefile
File metadata and controls
71 lines (50 loc) · 1.69 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
.PHONY: lint test test-verbose test-one test-ci templ templ-watch tailwind tailwind-watch generate air build dev release release-patch release-minor release-major build-release
.EXPORT_ALL_VARIABLES:
CGO_ENABLED = 1
OAR_VERSION ?= $(shell git rev-parse --short HEAD)
OAR_EXECUTABLE_FILENAME ?= oar
OAR_WEB_ASSETS_FILENAME ?= web-assets.tar.gz
OAR_BUILD_ARTIFACTS_DIR ?= dist
lint:
golangci-lint run --fix
test:
gotestsum --format testname ./...
test-verbose:
gotestsum --format standard-verbose -- -v -count=1 ./...
test-one:
@if [ -z "$(TEST)" ]; then \
echo "Usage: make test-one TEST=TestName"; \
exit 1; \
fi
gotestsum --format standard-verbose -- -v -count=1 -run "^$(TEST)$$" ./...
test-ci:
go run gotest.tools/gotestsum@latest --format testname -- -coverprofile=coverage.txt ./...
templ:
templ generate
templ-watch:
templ generate --watch
tailwind:
tailwindcss -i ./web/assets/css/input.css -o ./web/assets/css/output.css
tailwind-watch:
tailwindcss -i ./web/assets/css/input.css -o ./web/assets/css/output.css --watch
generate: tailwind templ
air:
air -c .air.toml
build:
go build -ldflags="-s -w -X github.com/oar-cd/oar/app.Version=$(OAR_VERSION)" -o ./${OAR_BUILD_ARTIFACTS_DIR}/$(OAR_EXECUTABLE_FILENAME) .
assets:
tar -czf ./${OAR_BUILD_ARTIFACTS_DIR}/${OAR_WEB_ASSETS_FILENAME} web/assets
build-release: build assets
run:
make -j4 tailwind-watch templ-watch air
release:
@echo "Available release types:"
@echo " make release-patch # Patch version (x.y.Z)"
@echo " make release-minor # Minor version (x.Y.0)"
@echo " make release-major # Major version (X.0.0)"
release-patch:
./release.sh patch
release-minor:
./release.sh minor
release-major:
./release.sh major