github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/scripts/release-update-extension-repo.sh (about) 1 #!/bin/bash 2 # 3 # Add a new tag to the extension repo. 4 # 5 # Usage: 6 # scripts/release-update-extension-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" 17 VERSION_PATTERN="^v[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-extensions "$ROOT" 28 29 set -x 30 cd "$ROOT" 31 git fetch --tags 32 git tag -a "$VERSION" -m "$VERSION" 33 git push origin "$VERSION" 34 35 rm -fR "$ROOT"