From 4e3b3a1d2f802d8c230eca17eaff114ae72583e5 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 3 Jan 2017 18:42:15 +0100 Subject: [PATCH 1/7] Also upload source tarball to github releases. --- .travis.yml | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2160d1758..865b3327f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -190,43 +190,18 @@ deploy: - release # This is the deploy target for the native build (Linux and macOS) - # which generates ZIPs per commit. We are in agreement that - # 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 + # which generates ZIPs per commit and the source tarball. # + # This runs for each tag that is created and adds the corresponding files. - provider: releases api_key: - secure: PWH37xVBCF0XiSjl+eH7XIdkrfxZXjzvqF4PiBOnD3VnFz+odrdnIwBmCeBYTHTWF8efpp8fmzWJk2UVq1JcpyZiC+SVxO8dx91W2ia1a+wKrEQuDgkUrZBkl5IQNCv0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hJOcf8sAHZx2N/HSfm7Im74ZFqJbHrWlx9aFKZ71BvSCPAbcp4hGw0A0Anynn9hOfxZjh5aqwxhz4ieTolCWaZCVyMveLJccu2ib2LVza2soHiSX2maFFlXqkoPd8h3vIGMR4CbqWfxAhXuxzMivOc24kPVHLEt5zq9635V519eOEEPYUs4X1ArZySKvJBbEcJ2RP+AZrZlj4=" + + overwrite: true + file: + - $TRAVIS_BUILD_DIR/solidity-$ZIP_SUFFIX.zip + - $TRAVIS_BUILD_DIR/solidity_source.tar.gz skip_cleanup: true on: - repo: ethereum/solidity - branch: release + tags: true condition: $TRAVIS_RELEASE == On From d63ac477bd6c9beb4abf079ae66146a0b8a6a758 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 3 Jan 2017 19:28:02 +0100 Subject: [PATCH 2/7] Try agian --- .travis.yml | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 865b3327f..d1953793e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,33 +54,6 @@ matrix: env: - ZIP_SUFFIX=ubuntu-trusty-clang - # Documentation target, which generates documentation using Phoenix / ReadTheDocs. - - os: linux - dist: trusty - sudo: required - compiler: gcc - env: - - TRAVIS_DOCS=On - - TRAVIS_RELEASE=Off - - TRAVIS_TESTS=Off - - # Emscripten target, which compiles 'solc' to javascript and uploads the resulting .js - # files to https://github.com/ethereum/solc-bin. These binaries are used in Browser-Solidity - # and in other Ethereum web-based development contexts. - - os: linux - dist: trusty - sudo: required - compiler: gcc - services: - - docker - before_install: - - docker pull trzeci/emscripten:sdk-tag-1.35.4-64bit - env: - - TRAVIS_EMSCRIPTEN=On - - TRAVIS_INSTALL_DEPS=Off - - TRAVIS_RELEASE=Off - - TRAVIS_TESTS=Off - # OS X Mavericks (10.9) # https://en.wikipedia.org/wiki/OS_X_Mavericks # @@ -195,7 +168,7 @@ deploy: # This runs for each tag that is created and adds the corresponding files. - provider: releases api_key: - secure: "kyDTn9taQ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DxB9J85kYdnLq3XBlcr1YoPMfTJ1UV7mpG4D1EDJObgToyCEDNbKS1Nf+osVcP8UcsrvhBCNXhPsFud8ZemaXmrVNhJOcf8sAHZx2N/HSfm7Im74ZFqJbHrWlx9aFKZ71BvSCPAbcp4hGw0A0Anynn9hOfxZjh5aqwxhz4ieTolCWaZCVyMveLJccu2ib2LVza2soHiSX2maFFlXqkoPd8h3vIGMR4CbqWfxAhXuxzMivOc24kPVHLEt5zq9635V519eOEEPYUs4X1ArZySKvJBbEcJ2RP+AZrZlj4= overwrite: true file: From ce6b28993edec617baad6be0c52a900c11e68606 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Jan 2017 10:13:51 +0100 Subject: [PATCH 3/7] only on release branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1953793e..79cfe2a89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -176,5 +176,5 @@ deploy: - $TRAVIS_BUILD_DIR/solidity_source.tar.gz skip_cleanup: true on: - tags: true + branch: release condition: $TRAVIS_RELEASE == On From c8eda1545147cff64102720067f8c64f90e29963 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Jan 2017 10:53:53 +0100 Subject: [PATCH 4/7] Create source tarball. --- .travis.yml | 8 +++++--- scripts/create_source_tarball.sh | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 scripts/create_source_tarball.sh diff --git a/.travis.yml b/.travis.yml index 79cfe2a89..d5600230e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -122,7 +122,8 @@ before_script: && cmake .. -DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE && make -j2 && cd .. - && ./scripts/release.sh $ZIP_SUFFIX ) + && ./scripts/release.sh $ZIP_SUFFIX + && ./scripts/create_source_tarball.sh ) script: - test $TRAVIS_DOCS != On || ./scripts/docs.sh @@ -171,9 +172,10 @@ deploy: secure: kyDTn9taQWSzALK2CbtJ9VC1KhIO3DzIM1aIwpJexPsEq6h1Wnjp3PoyyzJGf+09AjWZLM5lNcHy6/F9AEINgnEeekdMVNT1YIYsGSJ76z/pDXB4AOZKqGXdZgLNvmxZy9dWQJykBSV65kGgEZlihW/5gF0/ouxyZafYOYlwseA7H2NDDTdIzf5uV9oIPo/y3phXG1nxGcmE3tOH/bEJL+dv0C6hI3dhL7mQhmmBCgyo/ZlAEsdj0hbBF332dxqojGwfPeuFDrxvnWLX4jhbJAkrqKgcU+1lnsr7aI+RBHu7mV3/Fj+XfTrs3J9HvCjVfe0d9s1dMsIhdY8xT8NnZX618AiZYMIoQ1gE89R8uL/mN5BpcYG7U654FDG/+OTIa6VBMDxB9J85kYdnLq3XBlcr1YoPMfTJ1UV7mpG4D1EDJObgToyCEDNbKS1Nf+osVcP8UcsrvhBCNXhPsFud8ZemaXmrVNhJOcf8sAHZx2N/HSfm7Im74ZFqJbHrWlx9aFKZ71BvSCPAbcp4hGw0A0Anynn9hOfxZjh5aqwxhz4ieTolCWaZCVyMveLJccu2ib2LVza2soHiSX2maFFlXqkoPd8h3vIGMR4CbqWfxAhXuxzMivOc24kPVHLEt5zq9635V519eOEEPYUs4X1ArZySKvJBbEcJ2RP+AZrZlj4= overwrite: true + file_glob: true file: - - $TRAVIS_BUILD_DIR/solidity-$ZIP_SUFFIX.zip - - $TRAVIS_BUILD_DIR/solidity_source.tar.gz + - $TRAVIS_BUILD_DIR/solidity*.zip + - $TRAVIS_BUILD_DIR/solidity*tar.gz skip_cleanup: true on: branch: release diff --git a/scripts/create_source_tarball.sh b/scripts/create_source_tarball.sh new file mode 100755 index 000000000..350f6b4d2 --- /dev/null +++ b/scripts/create_source_tarball.sh @@ -0,0 +1,35 @@ +#!/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` + committimestamp=`git show --format=%ci HEAD | head -n 1` + 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" +) From 875fad2e75448fbfbb544af361111ab47a3bf1ec Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Jan 2017 11:59:11 +0100 Subject: [PATCH 5/7] On tags --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5600230e..c177e7b26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -178,5 +178,6 @@ deploy: - $TRAVIS_BUILD_DIR/solidity*tar.gz skip_cleanup: true on: - branch: release + all_branches: true + tags: true condition: $TRAVIS_RELEASE == On From c4ebd0ae91c320817261aee9b43cb4dba1cb37e7 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Jan 2017 12:41:18 +0100 Subject: [PATCH 6/7] Build on tags. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c177e7b26..89554aaaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,11 +26,13 @@ language: cpp 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. only: - develop - release + - /^v[0-9]/ matrix: include: # Ubuntu 14.04 LTS "Trusty Tahr" From 767413393b6b6a50d3006b5d65a4fc7e7354a82c Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 4 Jan 2017 13:03:11 +0100 Subject: [PATCH 7/7] Prerelease is present in release branch, no need to add it manually anymore. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89554aaaf..3135a8dee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,6 @@ cache: install: - test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh - 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: - test $TRAVIS_EMSCRIPTEN != On || ./scripts/build_emscripten.sh - test $TRAVIS_RELEASE != On || (mkdir -p build