-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
27 lines (19 loc) · 860 Bytes
/
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
NAME := $(shell basename "$(PWD)")
VERSION := "0.0.2"
.PHONY: build
build_linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/$(NAME)_linux -ldflags "-X main.Version=$(VERSION)"
build_mac:
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o bin/$(NAME)_mac -ldflags "-X main.Version=$(VERSION)"
build_mac_arm:
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o bin/$(NAME)_mac_arm -ldflags "-X main.Version=$(VERSION)"
build_windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/$(NAME).exe -ldflags "-X main.Version=$(VERSION)"
build:
go build -o bin/$(NAME) -ldflags "-X main.Version=$(VERSION)"
build_image: build_linux
docker build -t arjunmahishi/randome:$(VERSION) .
docker build -t arjunmahishi/randome:latest .
release: build_image
docker push arjunmahishi/randome:$(VERSION)
docker push arjunmahishi/randome:latest