Skip to content

Commit 70907af

Browse files
committed
trying releases
1 parent 2c0a2b0 commit 70907af

File tree

2 files changed

+59
-31
lines changed

2 files changed

+59
-31
lines changed

.travis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,18 @@ install:
1313

1414
script:
1515
- ./test.sh
16-
- goveralls -coverprofile=total.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN
16+
- goveralls -coverprofile=total.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN
17+
18+
before_deploy: ./build.sh
19+
20+
deploy:
21+
provider: releases
22+
api_key: "$GITHUB_TOKEN"
23+
file:
24+
- "releases/engine-utils-linux64.tar.gz"
25+
- "releases/engine-utils-mac64.tar.gz"
26+
- "releases/engine-utils-win386.zip"
27+
- "releases/engine-utils-win64.zip"
28+
skip_cleanup: true
29+
on:
30+
tags: true

build.sh

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,53 @@
11
#!/bin/bash
2+
3+
24
cd "$( dirname "$0" )"
35

46
programs=$(find . -type d | tail -n +2 | grep -v "git\|releases\|bin")
7+
name="engine-utils"
58

69
IFS=$'\n'
710
for prog in $programs; do
811
pushd $prog
9-
10-
echo "Linux Build..."
11-
export GOOS=linux
12-
export GOARCH=amd64
13-
arch="linux-amd64"
14-
mkdir -p ../releases/$arch
15-
go build -o ../releases/$arch/$prog .
16-
17-
echo "Mac Build..."
18-
export GOOS=darwin
19-
export GOARCH=amd64
20-
arch="mac-amd64"
21-
mkdir -p ../releases/$arch
22-
go build -o ../releases/$arch/$prog .
23-
24-
echo "Windows32 Build..."
25-
export GOOS=windows
26-
export GOARCH=386
27-
arch="windows-386"
28-
mkdir -p ../releases/$arch
29-
go build -o ../releases/$arch/$prog.exe .
30-
31-
echo "Windows64 Build..."
32-
export GOOS=windows
33-
export GOARCH=amd64
34-
arch="windows-amd64"
35-
mkdir -p ../releases/$arch
36-
go build -o ../releases/$arch/$prog.exe .
37-
12+
ls *.go >/dev/null
13+
if [ "$?" -eq "0" ]; then
14+
echo "Linux Build..."
15+
export GOOS=linux
16+
export GOARCH=amd64
17+
arch="linux-amd64"
18+
mkdir -p ../releases/${arch}
19+
go build -o ../releases/${arch}/$prog . || exit 1
20+
21+
echo "Mac Build..."
22+
export GOOS=darwin
23+
export GOARCH=amd64
24+
arch="mac-amd64"
25+
mkdir -p ../releases/${arch}
26+
go build -o ../releases/${arch}/$prog . || exit 1
27+
28+
echo "Windows32 Build..."
29+
export GOOS=windows
30+
export GOARCH=386
31+
arch="windows-386"
32+
mkdir -p ../releases/${arch}
33+
go build -o ../releases/${arch}/${prog}.exe . || exit 1
34+
35+
echo "Windows64 Build..."
36+
export GOOS=windows
37+
export GOARCH=amd64
38+
arch="windows-amd64"
39+
mkdir -p ../releases/${arch}
40+
go build -o ../releases/${arch}/${prog}.exe . || exit 1
41+
fi
3842
popd
39-
done
43+
done
44+
45+
echo "Adding EPDs"
46+
ls -d releases/*/ | xargs -n 1 cp -R testsuite/epds || exit 1
47+
48+
cd releases
49+
echo "Compressing"
50+
zip -r "${name}-win64.zip" "windows-amd64" || exit 1
51+
zip -r "${name}-win386.zip" "windows-386" || exit 1
52+
tar -zcvf "${name}-mac64.tar.gz" "mac-amd64" || exit 1
53+
tar -zcvf "${name}-linux64.tar.gz" "linux-amd64" || exit 1

0 commit comments

Comments
 (0)