mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 10:21:31 +03:00
42 lines
895 B
Plaintext
42 lines
895 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -ex
|
||
|
|
||
|
if [ -n "${TRAVIS_TAG-}" ]
|
||
|
then
|
||
|
ver="$TRAVIS_TAG"
|
||
|
elif [ -n "${TRAVIS_COMMIT-}" ]
|
||
|
then
|
||
|
ver="$TRAVIS_COMMIT"
|
||
|
else
|
||
|
ver="$(git rev-parse HEAD)"
|
||
|
fi
|
||
|
|
||
|
traced () {
|
||
|
echo '$' "$@" >&2; "$@"
|
||
|
}
|
||
|
|
||
|
buildTarball () {
|
||
|
local plat=${1}
|
||
|
local haskbin=${2}
|
||
|
|
||
|
tmp=$(mktemp -d)
|
||
|
mkdir -p $tmp/$ver-$plat
|
||
|
|
||
|
# Fetch the vere binary and unpack it into its destination
|
||
|
wget "https://bootstrap.urbit.org/vere-$ver-$plat.tgz"
|
||
|
tar xzvf vere-$ver-$plat.tgz --strip=1 -C $tmp/$ver-$plat
|
||
|
|
||
|
# Fetch king haskell and give it executable permissions.
|
||
|
wget "https://bootstrap.urbit.org/$haskbin-$ver" -O $tmp/$ver-$plat/urbit-king
|
||
|
chmod 555 $tmp/$ver-$plat/urbit-king
|
||
|
|
||
|
echo "packaging release/$ver-$plat.tgz"
|
||
|
(cd $tmp; tar cz $ver-$plat) > release/$ver-$plat.tgz
|
||
|
}
|
||
|
|
||
|
mkdir -p release
|
||
|
|
||
|
buildTarball "linux64" "king-linux64-dynamic"
|
||
|
buildTarball "darwin" "king-darwin-dynamic"
|