github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/scripts/release.sh (about)

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