Skip to content

Commit 0789385

Browse files
committed
releases
1 parent 263adc7 commit 0789385

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
execd
2+
build
3+
release

Makefile

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
1-
build: execd
2-
go build .
1+
NAME=execd
2+
OWNER=progrium
3+
ARCH=$(shell uname -m)
4+
VERSION=0.1.0
5+
6+
build:
7+
mkdir -p build/Linux && GOOS=linux CGO_ENABLED=0 go build -a \
8+
-installsuffix cgo \
9+
-o build/Linux/$(NAME)
10+
mkdir -p build/Darwin && GOOS=darwin CGO_ENABLED=0 go build -a \
11+
-installsuffix cgo \
12+
-o build/Darwin/$(NAME)
13+
14+
deps:
15+
go get -u github.com/progrium/gh-release/...
16+
go get || true
317

418
example: build
519
./execd -h localhost -p 2022 -k example/host_pk.pem example/authcheck example/helloworld
20+
21+
22+
release:
23+
rm -rf release && mkdir release
24+
tar -zcf release/$(NAME)_$(VERSION)_Linux_$(ARCH).tgz -C build/Linux $(NAME)
25+
tar -zcf release/$(NAME)_$(VERSION)_Darwin_$(ARCH).tgz -C build/Darwin $(NAME)
26+
gh-release create $(OWNER)/$(NAME) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD) v$(VERSION)
27+
28+
circleci:
29+
rm ~/.gitconfig
30+
rm -rf /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) && cd .. \
31+
&& mkdir -p /home/ubuntu/.go_workspace/src/github.com/$(OWNER) \
32+
&& mv $(NAME) /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) \
33+
&& ln -s /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) $(NAME)

circle.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
dependencies:
2+
pre:
3+
- make circleci
4+
override:
5+
- make deps
6+
- make build
7+
post:
8+
- tar -czvf $CIRCLE_ARTIFACTS/execd-linux.tgz -C build/Linux execd
9+
- tar -czvf $CIRCLE_ARTIFACTS/execd-darwin.tgz -C build/Darwin execd
10+
- tar -czvf $CIRCLE_ARTIFACTS/go-workspace.tgz -C ~/.go_workspace .
11+
12+
test:
13+
override:
14+
- /bin/true
15+
16+
deployment:
17+
release:
18+
branch: release
19+
commands:
20+
- make release

0 commit comments

Comments
 (0)