2017-01-04 12:21:41 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
REPO_ROOT="$(dirname "$0")"/..
|
|
|
|
(
|
|
|
|
cd "$REPO_ROOT"
|
2017-06-30 10:30:57 +00:00
|
|
|
version=$(scripts/get_version.sh)
|
2017-01-09 11:14:01 +00:00
|
|
|
commithash=$(git rev-parse --short=8 HEAD)
|
|
|
|
commitdate=$(git show --format=%ci HEAD | head -n 1 | cut - -b1-10 | sed -e 's/-0?/./' | sed -e 's/-0?/./')
|
2017-01-04 12:21:41 +00:00
|
|
|
|
|
|
|
# file exists and has zero size -> not a prerelease
|
2020-12-11 17:47:51 +00:00
|
|
|
if [ -e prerelease.txt ] && [ ! -s prerelease.txt ]
|
2017-01-04 12:21:41 +00:00
|
|
|
then
|
|
|
|
versionstring="$version"
|
|
|
|
else
|
2017-03-22 19:18:20 +00:00
|
|
|
versionstring="$version-nightly-$commitdate-$commithash"
|
2017-01-04 12:21:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
SOLDIR="$TEMPDIR/solidity_$versionstring/"
|
|
|
|
mkdir "$SOLDIR"
|
|
|
|
# Store the current source
|
|
|
|
git checkout-index -a --prefix="$SOLDIR"
|
|
|
|
# Store the commit hash
|
|
|
|
echo "$commithash" > "$SOLDIR/commit_hash.txt"
|
2020-12-11 17:47:51 +00:00
|
|
|
if [ -e prerelease.txt ] && [ ! -s prerelease.txt ]
|
2017-05-04 17:57:20 +00:00
|
|
|
then
|
|
|
|
cp prerelease.txt "$SOLDIR/"
|
|
|
|
fi
|
2017-01-04 12:21:41 +00:00
|
|
|
# Add dependencies
|
|
|
|
mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true
|
2021-09-24 12:37:51 +00:00
|
|
|
jsoncpp_version="1.9.3"
|
|
|
|
jsoncpp_package_path="$SOLDIR/deps/downloads/jsoncpp-${jsoncpp_version}.tar.gz"
|
|
|
|
wget -O "$jsoncpp_package_path" "https://github.com/open-source-parsers/jsoncpp/archive/${jsoncpp_version}.tar.gz"
|
2017-03-16 17:36:48 +00:00
|
|
|
mkdir -p "$REPO_ROOT/upload"
|
2019-01-07 12:02:01 +00:00
|
|
|
tar --owner 0 --group 0 -czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring"
|
2017-01-04 12:21:41 +00:00
|
|
|
rm -r "$TEMPDIR"
|
|
|
|
)
|