Skip to content

Commit

Permalink
release makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccarthy committed May 10, 2018
1 parent bd7899e commit af48939
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DEFAULT_GOAL := comply
GO_SOURCES := $(shell find . -name '*.go')
THEME_SOURCES := $(shell find themes)
VERSION := $(shell git describe --tags --always --dirty="-dev")
LDFLAGS := -ldflags='-X "cli.Version=$(VERSION)"'

assets: $(THEME_SOURCES)
go-bindata-assetfs -pkg theme -prefix themes themes/...
Expand All @@ -9,6 +11,15 @@ assets: $(THEME_SOURCES)
comply: assets $(GO_SOURCES)
go build github.com/strongdm/comply/cmd/comply

dist: clean
mkdir dist
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o dist/comply-$(VERSION)-darwin-amd64 github.com/strongdm/comply/cmd/comply
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o dist/comply-$(VERSION)-linux-amd64 github.com/strongdm/comply/cmd/comply

clean:
rm -rf dist
rm -f comply

install: assets $(GO_SOURCES)
go install github.com/strongdm/comply/cmd/comply

Expand All @@ -33,3 +44,29 @@ cleanse:
git push -f origin master
git gc --aggressive --prune=all

release: dist gh-release
github-release release \
--security-token $$GH_LOGIN \
--user strongdm \
--repo comply \
--tag $(VERSION) \
--name $(VERSION)

github-release upload \
--security-token $$GH_LOGIN \
--user strongdm \
--repo comply \
--tag $(VERSION) \
--name comply-$(VERSION)-darwin-amd64 \
--file dist/comply-$(VERSION)-darwin-amd64

github-release upload \
--security-token $$GH_LOGIN \
--user strongdm \
--repo comply \
--tag $(VERSION) \
--name comply-$(VERSION)-linux-amd64 \
--file dist/comply-$(VERSION)-linux-amd64

gh-release:
go get -u github.com/aktau/github-release

0 comments on commit af48939

Please sign in to comment.