forked from warden-protocol/wardenprotocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (44 loc) · 2.04 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
PWD=$(shell pwd)
VERSION=$(shell git describe --tags --always)
COMMIT=$(shell git rev-parse HEAD)
DIRTY=$(shell git diff --quiet || echo "-dirty")
FULL_VERSION=$(VERSION)$(DIRTY)
CHAIN_ID=wardenprotocol
OUTPUT_DIR=./build
LDFLAGS=-ldflags "-s -w -X github.com/cosmos/cosmos-sdk/version.Name=warden -X github.com/cosmos/cosmos-sdk/version.AppName=wardend -X github.com/cosmos/cosmos-sdk/version.Version=$(FULL_VERSION) -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) -X github.com/warden-protocol/wardenprotocol/cmd/wardenprotocold/cmd.ChainID=$(CHAIN_ID)"
TAG=$(shell git tag --points-at HEAD)
build-all: build-wardend build-faucet build-wardenkms
build: build-wardend
install: install-wardend
build-wardend:
go build $(LDFLAGS) -o $(OUTPUT_DIR)/wardend ./cmd/wardend
install-wardend:
go install $(LDFLAGS) ./cmd/wardend
build-faucet:
go build $(LDFLAGS) -o $(OUTPUT_DIR)/faucet ./cmd/faucet
build-wardenkms:
go build $(LDFLAGS) -o $(OUTPUT_DIR)/wardenkms ./cmd/wardenkms
release-wardend-cross-arm64:
@docker run \
--rm \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/go/src/wardend \
-w /go/src/wardend \
ghcr.io/goreleaser/goreleaser-cross:v1.22 \
--clean --skip=validate --skip=publish
release-wardend-linux-amd64:
@docker run \
--platform linux/amd64 \
--rm \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/go/src/wardend \
-w /go/src/wardend \
ghcr.io/goreleaser/goreleaser:v1.25.1 \
--clean --skip=publish -f ./.goreleaser-amd64.yaml
release-wardend: release-wardend-linux-amd64 release-wardend-cross-arm64
cat dist-linux-amd64/wardend_*_checksums.txt dist/wardend_*_checksums.txt > dist/checksums.txt
@if [ -z "$(TAG)" ] || [ -n "$(DIRTY)" ]; then echo "No tag found for the current commit. Won't proceed with GitHub release."; exit 1; fi
gh release create $(TAG) --title $(TAG) --verify-tag dist-linux-amd64/wardend_Linux_x86_64.zip dist/wardend_*.zip dist/checksums.txt
.PHONY: build-all build install build-wardend install-wardend build-faucet build-wardenkms