github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/scripts/release-update-tilt-repo.sh (about) 1 #!/bin/bash 2 # 3 # Updates the Tilt repo with the latest version info. 4 # 5 # Usage: 6 # scripts/release-update-tilt-repo.sh $VERSION 7 # where VERSION is of the form v0.1.0 8 9 set -euo pipefail 10 11 if [[ "${GITHUB_TOKEN-}" == "" ]]; then 12 echo "Missing GITHUB_TOKEN" 13 exit 1 14 fi 15 16 VERSION=${1//v/} 17 VERSION_PATTERN="^[0-9]+\\.[0-9]+\\.[0-9]+$" 18 if ! [[ $VERSION =~ $VERSION_PATTERN ]]; then 19 echo "Version did not match expected pattern. Actual: $VERSION" 20 exit 1 21 fi 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/tilt "$ROOT" 28 29 set -x 30 cd "$ROOT" 31 sed -i -E "s/version = \".*\"/version = \"$VERSION\"/" scripts/install.ps1 32 sed -i -E "s/VERSION=\".*\"/VERSION=\"$VERSION\"/" scripts/install.sh 33 sed -i -E "s/devVersion = \".*\"/devVersion = \"$VERSION\"/" internal/cli/build.go 34 git add . 35 git commit -a -m "Update version numbers: $VERSION" 36 git push origin master 37 38 rm -fR "$ROOT"