Skip to content

Commit

Permalink
add scripts to help with the release process
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks committed Sep 3, 2020
1 parent 10045df commit 02b5358
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 17 deletions.
17 changes: 1 addition & 16 deletions CONTRIBUTING.md
Expand Up @@ -287,22 +287,7 @@ release ought to be.
Add a [summary section](https://github.com/tilt-dev/company/blob/master/user-support/README.md#releases)
in the release notes.

After updating the release notes,
update the [install](https://github.com/tilt-dev/tilt.build/tree/master/docs/install.md) and [upgrade](https://github.com/tilt-dev/tilt.build/blob/master/docs/upgrade.md) docs,
the [default dev version](internal/cli/build.go),
the [installer bash script](scripts/install.sh), and
the [installer powershell script](scripts/install.ps1).

These should be updated as soon as possible to match the newest Tilt version
available, especially since the Tilt update nudge will send people to the upgrade
docs page to get the newest version. These version bump PRs can be merged
immediately without review.

To auto-generate new CLI docs, make sure you have tilt.build in a sibling directory of tilt, and run:

```
make cli-docs
```
The script has been updated to automatically update install scripts and docs.

### Version numbers
For pre-v1.0:
Expand Down
43 changes: 43 additions & 0 deletions scripts/release-update-tilt-docs-repo.sh
@@ -0,0 +1,43 @@
#!/bin/bash
#
# Updates the Tilt docs repo with the latest version info.
#
# Usage:
# scripts/update-docs-tilt-repo.sh $VERSION
# where VERSION is of the form 0.1.0

set -e

if [[ "$GITHUB_TOKEN" == "" ]]; then
echo "Missing GITHUB_TOKEN"
exit 1
fi

VERSION=$(echo "$1" | sed 's/v//')
VERSION_PATTERN="[0-9]+\.[0-9]+\.[0-9]+"
if ! [[ $VERSION =~ $VERSION_PATTERN ]]; then
echo "Version did not match expected pattern. Actual: $VERSION"
exit 1
fi

DIR=$(dirname "$0")
cd "$DIR/.."

ROOT=$(mktemp -d)
git clone https://goreleaser:$GITHUB_TOKEN@github.com/tilt-dev/tilt.build $ROOT

set -x
go run ./cmd/tilt/main.go dump cli-docs --dir=$ROOT/docs/cli
cd $ROOT
sed -i -e "s/asdf install tilt .*/asdf install tilt $VERSION/" docs/install.md
sed -i -e "s/asdf global tilt .*/asdf global tilt $VERSION/" docs/install.md

# sed doesn't support + modifiers
SED_VERSION_PATTERN="[0-9]*\.[0-9]*\.[0-9]*"
sed -i -e "s|/download/v$SED_VERSION_PATTERN/tilt.$SED_VERSION_PATTERN|/download/v$VERSION/tilt.$VERSION|" docs/install.md
sed -i -e "s|/download/v$SED_VERSION_PATTERN/tilt.$SED_VERSION_PATTERN|/download/v$VERSION/tilt.$VERSION|" docs/upgrade.md
git add .
git commit -a -m "Update version numbers: $VERSION"
#git push origin master

#rm -fR $ROOT
38 changes: 38 additions & 0 deletions scripts/release-update-tilt-repo.sh
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Updates the Tilt repo with the latest version info.
#
# Usage:
# scripts/update-tilt-repo.sh $VERSION
# where VERSION is of the form 0.1.0

set -e

if [[ "$GITHUB_TOKEN" == "" ]]; then
echo "Missing GITHUB_TOKEN"
exit 1
fi

VERSION=$(echo "$1" | sed 's/v//')
VERSION_PATTERN="[0-9]+\.[0-9]+\.[0-9]+"
if ! [[ $VERSION =~ $VERSION_PATTERN ]]; then
echo "Version did not match expected pattern. Actual: $VERSION"
exit 1
fi

DIR=$(dirname "$0")
cd "$DIR/.."

ROOT=$(mktemp -d)
git clone https://goreleaser:$GITHUB_TOKEN@github.com/tilt-dev/tilt $ROOT

set -x
cd $ROOT
sed -i -e "s/version = \".*\"/version = \"$VERSION\"/" scripts/install.ps1
sed -i -e "s/VERSION=\".*\"/VERSION=\"$VERSION\"/" scripts/install.sh
sed -i -e "s/devVersion = \".*\"/devVersion = \"$VERSION\"/" internal/cli/build.go
git add .
git commit -a -m "Update version numbers: $VERSION"
git push origin master

rm -fR $ROOT
6 changes: 5 additions & 1 deletion scripts/release.sh
Expand Up @@ -15,4 +15,8 @@ cd "$DIR/.."

./scripts/upload-assets.py latest
./scripts/goreleaser.sh
./scripts/record-release.sh "$(git describe --abbrev=0 --tags)"

VERSION=$(git describe --abbrev=0 --tags)
./scripts/release-update-tilt-repo.sh "$VERSION"
./scripts/release-update-tilt-docs-repo.sh "$VERSION"
./scripts/record-release.sh "$VERSION"

0 comments on commit 02b5358

Please sign in to comment.