urbit/sh/combine-release-builds
Elliot Glaysher 5e0f185df2 king: Build release tarballs with both king and vere.
This adds a new build stage called combine which takes the results
of the previous compile builds and packages them up into one
release tarball per platform.
2020-06-23 14:02:54 -07:00

42 lines
895 B
Bash
Executable File

#!/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"