From 0c2287b2018ae49e9d34748ec08dbfbf7a9d9813 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Fri, 7 Feb 2014 15:19:21 -0800 Subject: [PATCH] fix(scripts/build-release): use cross compilation --- scripts/build-release | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/build-release b/scripts/build-release index c376ae57582..199321169e2 100755 --- a/scripts/build-release +++ b/scripts/build-release @@ -23,17 +23,29 @@ function package { proj=${1} target=${2} - cp ${proj}/${proj} ${target} + ccdir="${proj}/bin/${GOOS}_${GOARCH}" + if [ -d ${ccdir} ]; then + cp ${ccdir}/${proj}* ${target} + else + cp ${proj}/bin/${proj} ${target} + fi + cp ${proj}/README.md ${target}/README-${proj}.md } -build etcd ${VER} -build etcdctl ${VER} -TARGET="etcd-$VER-$(uname -s)-$(uname -m)" -mkdir ${TARGET} +for i in darwin windows linux; do + export GOOS=${i} + export GOARCH="amd64" + + build etcd ${VER} + build etcdctl ${VER} + + TARGET="etcd-${VER}-${GOOS}-${GOARCH}" + mkdir ${TARGET} -package etcd ${TARGET} -package etcdctl ${TARGET} + package etcd ${TARGET} + package etcdctl ${TARGET} -tar cvvfz ${TARGET}.tar.gz ${TARGET} + tar cvvfz ${TARGET}.tar.gz ${TARGET} +done