Merge pull request #1542 from ethereum/publishTarball

Create source tarballs for releases.
This commit is contained in:
chriseth 2017-01-09 15:17:01 +01:00 committed by GitHub
commit 354a10be36
2 changed files with 49 additions and 36 deletions

View File

@ -26,11 +26,13 @@
language: cpp language: cpp
branches: branches:
# We need to whitelist the branches which we want to have "push" automation. # We need to whitelist the branches which we want to have "push" automation,
# this includes tags (which are treated as branches by travis).
# Pull request automation is not constrained to this set of branches. # Pull request automation is not constrained to this set of branches.
only: only:
- develop - develop
- release - release
- /^v[0-9]/
matrix: matrix:
include: include:
# Ubuntu 14.04 LTS "Trusty Tahr" # Ubuntu 14.04 LTS "Trusty Tahr"
@ -142,7 +144,6 @@ cache:
install: install:
- test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh - test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh
- echo -n "$TRAVIS_COMMIT" > commit_hash.txt - echo -n "$TRAVIS_COMMIT" > commit_hash.txt
- test "$TRAVIS_PULL_REQUESTS" != "false" || test "$TRAVIS_BRANCH" != release || echo -n > prerelease.txt # this is a proper release
before_script: before_script:
- test $TRAVIS_EMSCRIPTEN != On || ./scripts/build_emscripten.sh - test $TRAVIS_EMSCRIPTEN != On || ./scripts/build_emscripten.sh
- test $TRAVIS_RELEASE != On || (mkdir -p build - test $TRAVIS_RELEASE != On || (mkdir -p build
@ -150,7 +151,8 @@ before_script:
&& cmake .. -DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE && cmake .. -DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE
&& make -j2 && make -j2
&& cd .. && cd ..
&& ./scripts/release.sh $ZIP_SUFFIX ) && ./scripts/release.sh $ZIP_SUFFIX
&& ./scripts/create_source_tarball.sh )
script: script:
- test $TRAVIS_DOCS != On || ./scripts/docs.sh - test $TRAVIS_DOCS != On || ./scripts/docs.sh
@ -191,43 +193,20 @@ deploy:
- release - release
# This is the deploy target for the native build (Linux and macOS) # This is the deploy target for the native build (Linux and macOS)
# which generates ZIPs per commit. We are in agreement that # which generates ZIPs per commit and the source tarball.
# generating ZIPs per commit for the develop branch is probably
# just noise, so we only run this deployment target on 'release'.
#
# Unlike the Appveyor GitHub Releases target, the support in TravisCI
# seemingly doesn't provide a means for passing a description, tag, etc.
# In practice, we are letting the Appveyor CI do all that stuff, and
# then this deployment flow just seems to find that most recent tag,
# and just add our Linux and macOS ZIPs into the same tag, which is
# what we want to happen. But is very accidental and brittle-looking.
#
# The 'skip_cleanup' stops the workspace being cleaned out prior to
# generation of the artifacts. Strange that we should explicitly
# need to do that, but we do.
#
# Tokens in TravisCI can be generated a few different ways. Bob had
# success using the 'travis' gem, and then using that gem to
# create/edit this .travis.yml file, and then cut-and-pasting the
# good bits back out of what it generated. The gem changes all the
# whitespace and deletes comments, so cannot be used as-is. But
# it does generate an appropriate auth token.
#
# TODO - I do not know if the api_key below which work correctly
# for ethereum/solidity. I suspect not, for the same reason as
# my auth token does not work for Appveyor. I don't have enough
# permissions to enable this myself. Christian should be able to.
#
# See https://docs.travis-ci.com/user/deployment/releases
# See https://blog.travis-ci.com/2013-01-28-token-token-token/
# See https://github.com/ethereum/webthree-umbrella/issues/658
# #
# This runs for each tag that is created and adds the corresponding files.
- provider: releases - provider: releases
api_key: api_key:
secure: PWH37xVBCF0XiSjl+eH7XIdkrfxZXjzvqF4PiBOnD3VnFz+odrdnIwBmCeBYTHTWF8efpp8fmzWJk2UVq1JcpyZiC+SVxO8dx91W2ia1a+wKrEQuDgkUrZBkl5IQNCv0QS81DDQhliyZEaYh8wHO/7RReyMpGpw2U2u85WkFiZ+LdlHEZPfzUeh9lxQ9n8qwFL8Rja+Q05d4cQ8zaVEtofJJT4T6DUWhc3TzuxDYxOmjwg37rC9CkGSLn6VadSh8b3j5R0SZupFsAEvBL/imBLP9r9ewoo7o4p6By3jwiIgH9yNg7LM618xbffcNaYF/KtLBi9uPHfqF7hRD4PlECz+D0PR78nQItOX5HKm1QMg5kCnghRVCA0IVjpV5fiYQnMLM7dCRv34I5b3zLpa69wQ/GLYB2FViqNUfvPeiZTEeIJ2OmATlFx8AH2JoqpY1XJknWb35+vMfa8LSiJJW++SLWeV+ncC92hrvyZ1cy3trepRRZIfyYepxHifnfdWMkddQUJk5b2WS5Fy/TJLZNPeombnpvRhUC38dsYItarKeXTc6k4oADCEDZ2rgGIcEiqRxXV11Y5xHJekLDWzUs+YJNcCuL4pnAP//LOnbnH2w9rLpwhQYSl0anCd097NivAXQJXO2JI/byIYz1kiCVQWnW6EM8+72mLOklf/Qr8k= secure: PWH37xVBCF0XiSjl+eH7XIdkrfxZXjzvqF4PiBOnD3VnFz+odrdnIwBmCeBYTHTWF8efpp8fmzWJk2UVq1JcpyZiC+SVxO8dx91W2ia1a+wKrEQuDgkUrZBkl5IQNCv0QS81DDQhliyZEaYh8wHO/7RReyMpGpw2U2u85WkFiZ+LdlHEZPfzUeh9lxQ9n8qwFL8Rja+Q05d4cQ8zaVEtofJJT4T6DUWhc3TzuxDYxOmjwg37rC9CkGSLn6VadSh8b3j5R0SZupFsAEvBL/imBLP9r9ewoo7o4p6By3jwiIgH9yNg7LM618xbffcNaYF/KtLBi9uPHfqF7hRD4PlECz+D0PR78nQItOX5HKm1QMg5kCnghRVCA0IVjpV5fiYQnMLM7dCRv34I5b3zLpa69wQ/GLYB2FViqNUfvPeiZTEeIJ2OmATlFx8AH2JoqpY1XJknWb35+vMfa8LSiJJW++SLWeV+ncC92hrvyZ1cy3trepRRZIfyYepxHifnfdWMkddQUJk5b2WS5Fy/TJLZNPeombnpvRhUC38dsYItarKeXTc6k4oADCEDZ2rgGIcEiqRxXV11Y5xHJekLDWzUs+YJNcCuL4pnAP//LOnbnH2w9rLpwhQYSl0anCd097NivAXQJXO2JI/byIYz1kiCVQWnW6EM8+72mLOklf/Qr8k=
file: $TRAVIS_BUILD_DIR/solidity-$ZIP_SUFFIX.zip
overwrite: true
file_glob: true
file:
- $TRAVIS_BUILD_DIR/solidity*.zip
- $TRAVIS_BUILD_DIR/solidity*tar.gz
skip_cleanup: true skip_cleanup: true
on: on:
repo: ethereum/solidity all_branches: true
branch: release tags: true
condition: $TRAVIS_RELEASE == On condition: $TRAVIS_RELEASE == On

View File

@ -0,0 +1,34 @@
#!/usr/bin/env sh
#
set -e
REPO_ROOT="$(dirname "$0")"/..
(
cd "$REPO_ROOT"
version=$(grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")"? CMakeLists.txt)
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?/./')
# file exists and has zero size -> not a prerelease
if [ -e prerelease.txt -a ! -s prerelease.txt ]
then
versionstring="$version"
else
versionstring="$version-develop-$commitdate-$commithash"
fi
TEMPDIR=$(mktemp -d)
SOLDIR="$TEMPDIR/solidity_$versionstring/"
mkdir "$SOLDIR"
# Store the current source
git checkout-index -a --prefix="$SOLDIR"
git submodule foreach 'git checkout-index -a --prefix="'"$SOLDIR"'/$path/"'
# Store the commit hash
echo "$commithash" > "$SOLDIR/commit_hash.txt"
# Add dependencies
mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true
wget -O "$SOLDIR/deps/downloads/jsoncpp-1.7.7.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz
tar czf "$REPO_ROOT/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring"
rm -r "$TEMPDIR"
)