ghcup-hs/.gitlab/script/ghcup_release.sh

31 lines
721 B
Bash
Raw Normal View History

2020-04-19 15:00:05 +00:00
#!/bin/sh
set -eux
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
mkdir -p "$CI_PROJECT_DIR"/.local/bin
ecabal() {
cabal --store-dir="$(pwd)"/.store "$@"
}
git describe
2020-04-19 15:00:05 +00:00
# build
ecabal update
if [ "${OS}" = "LINUX" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static'
2020-04-27 14:23:44 +00:00
elif [ "${OS}" = "FREEBSD" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections' --constraint="zlib static"
2020-04-19 15:00:05 +00:00
else
ecabal build -w ghc-${GHC_VERSION} --constraint="zlib static" --constraint="lzma static"
2020-04-19 15:00:05 +00:00
fi
mkdir out
2020-04-19 17:23:54 +00:00
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" .
2020-04-19 15:00:05 +00:00
ver=$(./ghcup --numeric-version)
cp ghcup out/${ARTIFACT}-${ver}