-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathMakefile
48 lines (35 loc) · 1.01 KB
/
Makefile
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
ifndef SHA
SHA := $(shell git rev-parse HEAD)
endif
ASSETS := \
internal/ui/assets/edit/index.html \
internal/ui/assets/index.html
.PHONY: all clean develop
all: bin/go
bin/go: cmd/go/main.go $(ASSETS) $(shell find internal -name '*.go')
go build -o $@ ./cmd/go
bin/devserver: cmd/devserver/main.go $(ASSETS)
go build -o $@ ./cmd/devserver
node_modules/.build: package.json
npm install
touch $@
internal/ui/assets/edit/index.html: node_modules/.build $(shell find ui -type f)
npm run build
internal/ui/assets/index.html: node_modules/.build $(shell find ui -type f)
npm run build
develop: bin/devserver bin/go
bin/devserver
clean:
rm -rf bin internal/ui/assets
bin/buildimg:
GOBIN="$(CURDIR)/bin" go install github.com/kellegous/buildimg@latest
bin/publish: cmd/publish/main.go
go build -o $@ ./cmd/publish
publish: bin/publish
bin/publish \
--tag=latest \
--tag=$(shell git rev-parse --short $(SHA)) \
--platform=linux/arm64 \
--platform=linux/amd64 \
--build-arg=SHA=${SHA} \
--image=kellegous/go