github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/scripts/record-release.sh (about)

     1  #!/bin/bash
     2  
     3  # Updates cloud.tilt.dev with the new release.
     4  
     5  set -eu
     6  
     7  die() {
     8    echo "$*" 1>&2
     9    exit 1
    10  }
    11  
    12  if [ $# -ne 1 ]; then
    13    die "Usage: $0 <tilt version>"
    14  fi
    15  
    16  if [[ ! $1 =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
    17    die "error: first arg must be a version string of the form 'v#.#.#'. got '$1'."
    18  fi
    19  
    20  # strip the leading v, e.g., turn "v0.10.0" into "0.10.0"
    21  VERSION="${1#v}"
    22  
    23  DIR=$(dirname "$0")
    24  cd "$DIR/.."
    25  
    26  ROOT=$(mktemp -d)
    27  git clone https://tilt-releaser:"$GITHUB_TOKEN"@github.com/tilt-dev/cloud.tilt.dev "$ROOT"
    28  cd "$ROOT"
    29  echo "{\"Found\":false,\"Username\":\"\",\"TeamName\":\"\",\"TeamRole\":\"\",\"SuggestedTiltVersion\":\"$VERSION\",\"UserID\":0}" > "$ROOT/web/api/whoami"
    30  
    31  git commit -a -m "Notify all tilt users of new version: $VERSION"
    32  git push origin main
    33  
    34  rm -fR "$ROOT"