You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

  1. #!/usr/bin/env bash
  2. set -e
  3. REPO_NAME="abci"
  4. # Get the version from the environment, or try to figure it out.
  5. if [ -z $VERSION ]; then
  6. VERSION=$(awk -F\" '/Version =/ { print $2; exit }' < version/version.go)
  7. fi
  8. if [ -z "$VERSION" ]; then
  9. echo "Please specify a version."
  10. exit 1
  11. fi
  12. echo "==> Building version $VERSION..."
  13. # Get the parent directory of where this script is.
  14. SOURCE="${BASH_SOURCE[0]}"
  15. while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
  16. DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
  17. # Change into that dir because we expect that.
  18. cd "$DIR"
  19. ## Generate the tag.
  20. #if [ -z "$NOTAG" ]; then
  21. # echo "==> Tagging..."
  22. # git commit --allow-empty -a -m "Release v$VERSION"
  23. # git tag -a -m "Version $VERSION" "v${VERSION}" master
  24. #fi
  25. # Do a hermetic build inside a Docker container.
  26. docker build -t tendermint/${REPO_NAME}-builder scripts/${REPO_NAME}-builder/
  27. docker run --rm -e "BUILD_TAGS=$BUILD_TAGS" -v "$(pwd)":/go/src/github.com/tendermint/${REPO_NAME} tendermint/${REPO_NAME}-builder ./scripts/dist_build.sh
  28. # Add $REPO_NAME and $VERSION prefix to package name.
  29. rm -rf ./build/dist
  30. mkdir -p ./build/dist
  31. for FILENAME in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type f); do
  32. FILENAME=$(basename "$FILENAME")
  33. cp "./build/pkg/${FILENAME}" "./build/dist/${REPO_NAME}_${VERSION}_${FILENAME}"
  34. done
  35. # Make the checksums.
  36. pushd ./build/dist
  37. shasum -a256 ./* > "./${REPO_NAME}_${VERSION}_SHA256SUMS"
  38. popd
  39. # Done
  40. echo
  41. echo "==> Results:"
  42. ls -hl ./build/dist
  43. exit 0