Commit 60f046e 1 parent f2b80d1 commit 60f046e Copy full SHA for 60f046e
File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
- # the current tag else the current git sha
2
- VERSION := $(shell git tag --points-at=HEAD | grep . || git rev-parse --short HEAD)
3
-
4
- GOBUILD_ARGS := -ldflags "-X main.Version=$(VERSION ) "
5
- OS := $(shell go env GOOS)
6
- ARCH := $(shell go env GOHOSTARCH)
1
+ VERSION =$(shell git describe --tags --candidates=1 --dirty)
2
+ FLAGS =-X main.Version=$(VERSION ) -s -w
7
3
8
4
# To create a new release:
9
5
# $ git tag vx.x.x
10
6
# $ git push --tags
11
7
# $ make clean
12
- # $ make release # this will create 2 binaries in ./bin - darwin and linux
8
+ # $ make release # this will create 3 binaries in ./bin
13
9
#
14
10
# Next, go to https://github.com/99designs/iamy/releases/new
15
11
# - select the tag version you just created
16
12
# - Attach the binaries from ./bin/*
17
13
18
- release : bin/iamy-linux-amd64 bin/iamy-$( OS ) - $( ARCH )
14
+ release : bin/iamy-linux-amd64 bin/iamy-darwin-amd64 bin/iamy-windows-386.exe
19
15
20
16
bin/iamy-linux-amd64 :
21
17
@mkdir -p bin
22
- docker run -it -v $$ GOPATH:/go golang:latest go build $(GOBUILD_ARGS ) -o /go/src/github.com/99designs/iamy/$@ github.com/99designs/iamy
18
+ GOOS=linux GOARCH=amd64 go build -o $@ -ldflags=" $( FLAGS) " .
19
+
20
+ bin/iamy-darwin-amd64 :
21
+ @mkdir -p bin
22
+ GOOS=darwin GOARCH=amd64 go build -o $@ -ldflags=" $( FLAGS) " .
23
23
24
- bin/iamy-$( OS ) - $( ARCH ) :
24
+ bin/iamy-windows-386.exe :
25
25
@mkdir -p bin
26
- go build $( GOBUILD_ARGS ) -o bin/iamy- $( OS ) - $( ARCH ) .
26
+ GOOS=windows GOARCH=386 go build -o $@ -ldflags= " $( FLAGS ) " .
27
27
28
28
clean :
29
29
rm -f bin/*
You can’t perform that action at this time.
0 commit comments