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.6 KiB

  1. #!/usr/bin/env bash
  2. set -e
  3. # Get the version from the environment, or try to figure it out.
  4. if [ -z $VERSION ]; then
  5. VERSION=$(awk -F\" 'TMCoreSemVer =/ { print $2; exit }' < version/version.go)
  6. fi
  7. if [ -z "$VERSION" ]; then
  8. echo "Please specify a version."
  9. exit 1
  10. fi
  11. echo "==> Releasing version $VERSION..."
  12. # Get the parent directory of where this script is.
  13. SOURCE="${BASH_SOURCE[0]}"
  14. while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
  15. DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
  16. # Change into that dir because we expect that.
  17. cd "$DIR"
  18. # Building binaries
  19. sh -c "'$DIR/scripts/dist.sh'"
  20. # Pushing binaries to S3
  21. sh -c "'$DIR/scripts/publish.sh'"
  22. # echo "==> Crafting a Github release"
  23. # today=$(date +"%B-%d-%Y")
  24. # ghr -b "https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md#${VERSION//.}-${today,}" "v$VERSION" "$DIR/build/dist"
  25. # Build and push Docker image
  26. ## Get SHA256SUM of the linux archive
  27. SHA256SUM=$(shasum -a256 "${DIR}/build/dist/tendermint_${VERSION}_linux_amd64.zip" | awk '{print $1;}')
  28. ## Replace TM_VERSION and TM_SHA256SUM with the new values
  29. sed -i -e "s/TM_VERSION .*/TM_VERSION $VERSION/g" "$DIR/DOCKER/Dockerfile"
  30. sed -i -e "s/TM_SHA256SUM .*/TM_SHA256SUM $SHA256SUM/g" "$DIR/DOCKER/Dockerfile"
  31. git commit -m "update Dockerfile" -a "$DIR/DOCKER/Dockerfile"
  32. echo "==> TODO: update DOCKER/README.md (latest Dockerfile's hash is $(git rev-parse HEAD)) and copy it's content to https://store.docker.com/community/images/tendermint/tendermint"
  33. pushd "$DIR/DOCKER"
  34. ## Build Docker image
  35. TAG=$VERSION sh -c "'./build.sh'"
  36. ## Push Docker image
  37. TAG=$VERSION sh -c "'./push.sh'"
  38. popd
  39. exit 0