forked from czarcas7ic/cosmprund
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (58 loc) · 1.76 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
VERSION := $(shell git describe --tags)
COMMIT := $(shell git log -1 --format='%H')
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
all: install
build:
@echo "Building cosmprund"
@go build -mod readonly $(BUILD_FLAGS) -o build/cosmprund main.go
clean:
rm -rf build
.PHONY: all lint test race msan tools clean build
###############################################################################
### Docker ###
###############################################################################
docker-build:
docker build -t cosmprund:local .
docker-run:
docker run cosmprund:local
###############################################################################
### Release ###
###############################################################################
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION)
ifdef GITHUB_TOKEN
release:
docker run \
--rm \
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/diffusion \
-w /go/src/diffusion \
$(GORELEASER_IMAGE) \
release \
--clean
else
release:
@echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'."
endif
release-dry-run:
docker run \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/diffusion \
-w /go/src/diffusion \
$(GORELEASER_IMAGE) \
release \
--clean \
--skip=publish
release-snapshot:
docker run \
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/osmosisd \
-w /go/src/osmosisd \
$(GORELEASER_IMAGE) \
release \
--clean \
--snapshot \
--skip=validate \
--skip=publish