-
Notifications
You must be signed in to change notification settings - Fork 1
/
wercker.yml
59 lines (50 loc) · 1.55 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
box: golang
build:
steps:
- setup-go-workspace
- termie/glide-build@2014.345.145
deploy:
steps:
# Install file utility needed by gox
- script:
name: apt-update/install file, jq
code: |
apt-get update -qy && apt-get install -qy file jq
# Get the git tag of this commit, otherwise fail on this step
# Only tagged commits will be deployed
# # export GIT_TAG=`git describe --tags --exact-match "${WERCKER_GIT_COMMIT}" 2>/dev/null` && test -n "$GIT_TAG"
- script:
name: git tag
code: |
echo "Wercker commit: $WERCKER_GIT_COMMIT"
export GIT_TAG=$(curl https://api.github.com/repos/mudler/boson/tags | jq -r ".[] | select(.commit.sha == \"${WERCKER_GIT_COMMIT}\") | .name")
echo "Git tag is: $GIT_TAG"
test -n "$GIT_TAG"
# Setup go workspace
- setup-go-workspace
# Build source using glide
- termie/glide-build@2014.345.145
# Install gox
- script:
name: gox install
code: |
go get github.com/mitchellh/gox
# Build all binaries
- script:
name: gox build
code: |
$GOPATH/bin/gox -os="linux"
# Create a release based on the current tag
- github-create-release:
token: $GITHUB_TOKEN
tag: $GIT_TAG
# Upload all assets
- github-upload-asset:
token: $GITHUB_TOKEN
file: boson_linux_386
- github-upload-asset:
token: $GITHUB_TOKEN
file: boson_linux_amd64
- github-upload-asset:
token: $GITHUB_TOKEN
file: boson_linux_arm