diff --git a/.travis.yml b/.travis.yml index 6fbfc591e2..e9f7b659fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,18 @@ +stages: + - compile + # Don't run the combine stage in pull requests, because deploy is disabled there. + - name: combine + if: type != pull_request + jobs: include: - - os: linux + - stage: compile + os: linux language: nix nix: 2.3.6 before_install: - git lfs pull + - echo "trusted-users = root travis" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon install: - nix-env -iA cachix -f https://cachix.org/api/v1/install script: @@ -14,7 +22,8 @@ jobs: - make release - sh/ci-tests - - os: linux + - stage: compile + os: linux language: generic env: STACK_YAML=pkg/hs/stack.yaml cache: @@ -31,7 +40,8 @@ jobs: - stack test - sh/release-king-linux64-dynamic - - os: osx + - stage: compile + os: osx language: generic sudo: required env: STACK_YAML=pkg/hs/stack.yaml @@ -49,6 +59,12 @@ jobs: - stack test - sh/release-king-darwin-dynamic + - stage: combine + os: linux + language: generic + script: + - sh/combine-release-builds + deploy: - skip_cleanup: true provider: gcs diff --git a/sh/combine-release-builds b/sh/combine-release-builds new file mode 100755 index 0000000000..844b542f09 --- /dev/null +++ b/sh/combine-release-builds @@ -0,0 +1,41 @@ +#!/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" diff --git a/sh/release b/sh/release index 10f6ed1b60..0207a9390d 100755 --- a/sh/release +++ b/sh/release @@ -23,11 +23,11 @@ do sh/cross urbit "$plat" tmp=$(mktemp -d) - mkdir -p $tmp/$ver-$plat - traced cp -r cross/$plat/* $tmp/$ver-$plat + mkdir -p $tmp/vere-$ver-$plat + traced cp -r cross/$plat/* $tmp/vere-$ver-$plat - echo "packaging release/$ver-$plat.tgz" - (cd $tmp; tar cz $ver-$plat) > release/$ver-$plat.tgz + echo "packaging release/vere-$ver-$plat.tgz" + (cd $tmp; tar cz vere-$ver-$plat) > release/vere-$ver-$plat.tgz rm -rf $tmp done