Skip to content

Commit

Permalink
trying releases
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbackes committed Jun 2, 2016
1 parent 2c0a2b0 commit 70907af
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 31 deletions.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ install:

script:
- ./test.sh
- goveralls -coverprofile=total.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN
- goveralls -coverprofile=total.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN

before_deploy: ./build.sh

deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file:
- "releases/engine-utils-linux64.tar.gz"
- "releases/engine-utils-mac64.tar.gz"
- "releases/engine-utils-win386.zip"
- "releases/engine-utils-win64.zip"
skip_cleanup: true
on:
tags: true
74 changes: 44 additions & 30 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
#!/bin/bash


cd "$( dirname "$0" )"

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

IFS=$'\n'
for prog in $programs; do
pushd $prog

echo "Linux Build..."
export GOOS=linux
export GOARCH=amd64
arch="linux-amd64"
mkdir -p ../releases/$arch
go build -o ../releases/$arch/$prog .

echo "Mac Build..."
export GOOS=darwin
export GOARCH=amd64
arch="mac-amd64"
mkdir -p ../releases/$arch
go build -o ../releases/$arch/$prog .

echo "Windows32 Build..."
export GOOS=windows
export GOARCH=386
arch="windows-386"
mkdir -p ../releases/$arch
go build -o ../releases/$arch/$prog.exe .

echo "Windows64 Build..."
export GOOS=windows
export GOARCH=amd64
arch="windows-amd64"
mkdir -p ../releases/$arch
go build -o ../releases/$arch/$prog.exe .

ls *.go >/dev/null
if [ "$?" -eq "0" ]; then
echo "Linux Build..."
export GOOS=linux
export GOARCH=amd64
arch="linux-amd64"
mkdir -p ../releases/${arch}
go build -o ../releases/${arch}/$prog . || exit 1

echo "Mac Build..."
export GOOS=darwin
export GOARCH=amd64
arch="mac-amd64"
mkdir -p ../releases/${arch}
go build -o ../releases/${arch}/$prog . || exit 1

echo "Windows32 Build..."
export GOOS=windows
export GOARCH=386
arch="windows-386"
mkdir -p ../releases/${arch}
go build -o ../releases/${arch}/${prog}.exe . || exit 1

echo "Windows64 Build..."
export GOOS=windows
export GOARCH=amd64
arch="windows-amd64"
mkdir -p ../releases/${arch}
go build -o ../releases/${arch}/${prog}.exe . || exit 1
fi
popd
done
done

echo "Adding EPDs"
ls -d releases/*/ | xargs -n 1 cp -R testsuite/epds || exit 1

cd releases
echo "Compressing"
zip -r "${name}-win64.zip" "windows-amd64" || exit 1
zip -r "${name}-win386.zip" "windows-386" || exit 1
tar -zcvf "${name}-mac64.tar.gz" "mac-amd64" || exit 1
tar -zcvf "${name}-linux64.tar.gz" "linux-amd64" || exit 1

0 comments on commit 70907af

Please sign in to comment.