Skip to content

Commit

Permalink
releases
Browse files Browse the repository at this point in the history
  • Loading branch information
progrium committed Jun 18, 2015
1 parent 263adc7 commit 0789385
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
execd
build
release
32 changes: 30 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
build: execd
go build .
NAME=execd
OWNER=progrium
ARCH=$(shell uname -m)
VERSION=0.1.0

build:
mkdir -p build/Linux && GOOS=linux CGO_ENABLED=0 go build -a \
-installsuffix cgo \
-o build/Linux/$(NAME)
mkdir -p build/Darwin && GOOS=darwin CGO_ENABLED=0 go build -a \
-installsuffix cgo \
-o build/Darwin/$(NAME)

deps:
go get -u github.com/progrium/gh-release/...
go get || true

example: build
./execd -h localhost -p 2022 -k example/host_pk.pem example/authcheck example/helloworld


release:
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_Linux_$(ARCH).tgz -C build/Linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_Darwin_$(ARCH).tgz -C build/Darwin $(NAME)
gh-release create $(OWNER)/$(NAME) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD) v$(VERSION)

circleci:
rm ~/.gitconfig
rm -rf /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) && cd .. \
&& mkdir -p /home/ubuntu/.go_workspace/src/github.com/$(OWNER) \
&& mv $(NAME) /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) \
&& ln -s /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) $(NAME)
20 changes: 20 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dependencies:
pre:
- make circleci
override:
- make deps
- make build
post:
- tar -czvf $CIRCLE_ARTIFACTS/execd-linux.tgz -C build/Linux execd
- tar -czvf $CIRCLE_ARTIFACTS/execd-darwin.tgz -C build/Darwin execd
- tar -czvf $CIRCLE_ARTIFACTS/go-workspace.tgz -C ~/.go_workspace .

test:
override:
- /bin/true

deployment:
release:
branch: release
commands:
- make release

0 comments on commit 0789385

Please sign in to comment.