Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/bin/bash

set -e
# Requires go, rkt to be installed prior to running

VERSION="0.4.0"

rm -rf dist
mkdir dist

# Small test for rkt being installed
RKT=`which rkt`
if [ "$?" -eq "1" ]
then
echo "rkt not installed. See https://coreos.com/rkt/docs/latest/distributions.html to install"
exit 1
fi

for ENV in $( go tool dist list | grep -v 'android' | grep -v 'darwin/arm' | grep -v 's390x' | grep -v 'plan9/arm'); do
eval $( echo $ENV | tr '/' ' ' | xargs printf 'export GOOS=%s; export GOARCH=%s\n' )

Expand All @@ -22,7 +29,7 @@ for ENV in $( go tool dist list | grep -v 'android' | grep -v 'darwin/arm' | gre

echo "Building for GOOS=$GOOS GOARCH=$GOARCH"

sudo rkt run \
sudo ${RKT} run \
--set-env=GOOS=${GOOS} \
--set-env=GOARCH=${GOARCH} \
--set-env=CGO_ENABLED=0 \
Expand All @@ -34,7 +41,7 @@ for ENV in $( go tool dist list | grep -v 'android' | grep -v 'darwin/arm' | gre
-o /go/src/github.com/ericchiang/pup/dist/${BIN} \
github.com/ericchiang/pup

sudo rkt gc --grace-period=0s
sudo ${RKT} gc --grace-period=0s

zip dist/pup_v${VERSION}_${GOOS}_${GOARCH}.zip -j dist/${BIN}
rm -f dist/${BIN}
Expand Down