Skip to content

Commit

Permalink
publish to github not docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cozmo committed Oct 31, 2016
1 parent 2c5ba9e commit 9a7ec96
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
19 changes: 9 additions & 10 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ notify:
webhook_url: $$slack_webhook
publish:
report_card: {}
docker:
docker_host: $$docker_server
email: $$docker_email
image_name: clever/wag
password: $$docker_password
registry_login: true
tags:
- $(git rev-parse --short HEAD)
- latest
username: $$docker_username
github:
artifacts:
- release
repo: wag
script:
- make release
tag: v$(cat VERSION)
token: $$github_token
user: Clever
when:
branch: master
script:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ bin/

vendor/
badcode.txt
release/
.DS_Store

16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
include golang.mk
.DEFAULT_GOAL := test # override default goal set in library makefile
.PHONY: test build
.PHONY: test build release
PKG := github.com/Clever/wag
PKGS := $(shell go list ./... | grep -v /vendor | grep -v /samples/gen* | grep -v /hardcoded)
VERSION := $(shell head -n 1 VERSION)
EXECUTABLE := wag

$(eval $(call golang-version-check,1.7))

MOCKGEN := $(GOPATH)/bin/mockgen
Expand All @@ -11,8 +14,7 @@ $(MOCKGEN):
go get -u github.com/golang/mock/mockgen

build: hardcoded/hardcoded.go
# disable CGO and link completely statically (this is to enable us to run in containers that don't use glibc)
CGO_ENABLED=0 go build -installsuffix cgo -o bin/wag
go build -o bin/wag

test: build generate $(PKGS)

Expand Down Expand Up @@ -43,3 +45,11 @@ $(GOPATH)/bin/glide:

install_deps: $(GOPATH)/bin/glide
$(GOPATH)/bin/glide install -v

release: hardcoded/hardcoded.go
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version=$(VERSION)" -o="$@/$(EXECUTABLE)"
tar -C $@ -zcvf "$@/$(EXECUTABLE)-$(VERSION)-linux-amd64.tar.gz" $(EXECUTABLE)
@rm "$@/$(EXECUTABLE)"
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.version=$(VERSION)" -o="$@/$(EXECUTABLE)"
tar -C $@ -zcvf "$@/$(EXECUTABLE)-$(VERSION)-darwin-amd64.tar.gz" $(EXECUTABLE)
@rm "$@/$(EXECUTABLE)"
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit 9a7ec96

Please sign in to comment.