Skip to content

Commit b45e5a6

Browse files
adding travis functionality
1 parent 75b7d98 commit b45e5a6

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.travis.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
language: go
2+
3+
go: 1.10.1
4+
5+
before_install:
6+
- go get github.com/disintegration/gift
7+
- go get github.com/urfave/cli
8+
9+
install: go build -o ionic-resource-generator
10+
11+
before_deploy:
12+
- PLATFORMS=(darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64)
13+
14+
# build binary for all archs
15+
- |
16+
for PLATFORM in "${PLATFORMS[@]}"; do
17+
echo "Building $PLATFORM"
18+
GOOS=${PLATFORM%/*}
19+
GOARCH=${PLATFORM#*/}
20+
21+
if [ "$GOOS" = "windows" ]; then
22+
build_cmd="GOOS=$GOOS GOARCH=$GOARCH go build -o ionic-resource-generator -ldflags '-w -s'"
23+
else
24+
build_cmd="CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -o ionic-resource-generator -ldflags '-d -w -s'"
25+
fi
26+
if ! eval $build_cmd; then
27+
echo "Failed building ionic-resource-generator for $PLATFORM" && return 1
28+
fi
29+
30+
if [ "$GOOS" = "windows" ]; then
31+
zip ionic-resource-generator-${GOOS}-${GOARCH}.zip ionic-resource-generator
32+
else
33+
tar cvzf ionic-resource-generator-${GOOS}-${GOARCH}.tgz ionic-resource-generator
34+
fi
35+
done
36+
37+
- ls
38+
39+
deploy:
40+
provider: releases
41+
api_key: $AUTH_TOKEN
42+
file:
43+
- "ionic-resource-generator-darwin-386.tgz"
44+
- "ionic-resource-generator-darwin-amd64.tgz"
45+
46+
- "ionic-resource-generator-freebsd-386.tgz"
47+
- "ionic-resource-generator-freebsd-arm.tgz"
48+
- "ionic-resource-generator-freebsd-amd64.tgz"
49+
50+
- "ionic-resource-generator-linux-386.tgz"
51+
- "ionic-resource-generator-linux-arm.tgz"
52+
- "ionic-resource-generator-linux-amd64.tgz"
53+
54+
- "ionic-resource-generator-windows-386.zip"
55+
- "ionic-resource-generator-windows-amd64.zip"
56+
57+
skip_cleanup: true
58+
on:
59+
tags: true

0 commit comments

Comments
 (0)