forked from vegaprotocol/vegawallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
32 lines (25 loc) · 1.34 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
ifeq ($(CI),)
# Not in CI
VERSION := dev-$(USER)
VERSION_HASH := $(shell git rev-parse HEAD | cut -b1-8)
else
# In CI
ifneq ($(RELEASE_VERSION),)
VERSION := $(RELEASE_VERSION)
else
# No tag, so make one
VERSION := $(shell git describe --tags 2>/dev/null)
endif
VERSION_HASH := $(shell echo "$(GITHUB_SHA)" | cut -b1-8)
endif
install:
go install -v -ldflags "-X code.vegaprotocol.io/go-wallet/version.Version=${VERSION} -X code.vegaprotocol.io/go-wallet/version.VersionHash=${VERSION_HASH}"
release-windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -o build/vegawallet.exe -ldflags "-X code.vegaprotocol.io/go-wallet/version.Version=${VERSION} -X code.vegaprotocol.io/go-wallet/version.VersionHash=${VERSION_HASH}"
cd build && 7z a -tzip vegawallet-windows-amd64.zip vegawallet.exe
release-macos:
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -o build/vegawallet -ldflags "-X code.vegaprotocol.io/go-wallet/version.Version=${VERSION} -X code.vegaprotocol.io/go-wallet/version.VersionHash=${VERSION_HASH}"
cd build && zip vegawallet-darwin-amd64.zip vegawallet
release-linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o build/vegawallet -ldflags "-X code.vegaprotocol.io/go-wallet/version.Version=${VERSION} -X code.vegaprotocol.io/go-wallet/version.VersionHash=${VERSION_HASH}"
cd build && zip vegawallet-linux-amd64.zip vegawallet