-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (33 loc) · 1.42 KB
/
Makefile
File metadata and controls
42 lines (33 loc) · 1.42 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
NAME=server-pulse
VERSION=$(shell cat VERSION)
BUILD=$(shell git rev-parse --short HEAD)
LD_FLAGS="-w -X main.version=$(VERSION) -X main.build=$(BUILD)"
clean:
rm -rf _build/ release/
build:
go mod download
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o server-pulse
build-all:
mkdir -p _build
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/server-pulse-$(VERSION)-linux-amd64
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/server-pulse-$(VERSION)-linux-arm
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/server-pulse-$(VERSION)-linux-arm64
GOOS=linux GOARCH=ppc64le CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o _build/server-pulse-$(VERSION)-linux-ppc64le
cd _build; sha256sum * > sha256sums.txt
update-release:
for a in $$(gh release view v$(VERSION) --json assets --jq '.assets[].name'); do \
gh release delete-asset v$(VERSION) $$a; \
done
gh release upload v$(VERSION) _build/* --clobber
run-dev:
rm -f server-pulse.sock server-pulse
go build -ldflags $(LD_FLAGS) -o server-pulse
server-pulse_DEBUG=1 ./server-pulse
image:
docker build -t server-pulse -f Dockerfile .
release:
mkdir -p release
cp _build/* release
cd release; sha256sum --quiet --check sha256sums.txt && \
gh release create v$(VERSION) -d -t v$(VERSION) *
.PHONY: build