Skip to content

Commit

Permalink
make a script to prepare a release
Browse files Browse the repository at this point in the history
  • Loading branch information
eeeebbbbrrrr committed May 26, 2023
1 parent 1b1aaff commit e44c20a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
16 changes: 1 addition & 15 deletions HOW_TO_CUT_A_PGRX_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
```shell
export NEW_VERSION=""
git switch develop
git fetch origin
git diff origin/develop | if [ "$0" = "" ]; then
echo "git diff found local changes on develop branch, cannot cut release."
elif [ "$NEW_VERSION" = "" ]; then
echo "No version set. Are you just copying and pasting this without checking?"
else
git pull origin develop --ff-only
git switch -c "prepare-${NEW_VERSION}"
./update-versions.sh "${NEW_VERSION}"
git diff # sanity check the diffs
git commit -a -m "Update version to ${NEW_VERSION}"
git push --set-upstream origin "prepare-${NEW_VERSION}"
fi
./prepare-release.sh NEW_VERSION_NUMBER
```

- go make a PR to `develop` on GitHub
Expand Down
29 changes: 29 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /usr/bin/env bash

NEW_VERSION=$1
if [ -z "${NEW_VERSION}" ]; then
echo "Usage: ./prepare-release.sh NEW_VERSION_NUMBER"
exit 1
fi

git switch develop
git fetch origin
git diff origin/develop | if [ "$0" = "" ]; then
echo "git diff found local changes on develop branch, cannot cut release."
elif [ "$NEW_VERSION" = "" ]; then
echo "No version set. Are you just copying and pasting this without checking?"
else
git pull origin develop --ff-only
git switch -c "prepare-${NEW_VERSION}"

# exit early if the script fails
./update-versions.sh "${NEW_VERSION}" || exit $?

# sanity check the diffs, but not Cargo.lock files cuz ugh
git diff -- . ':(exclude)Cargo.lock'

# send it all to github
git commit -a -m "Update version to ${NEW_VERSION}"
git push --set-upstream origin "prepare-${NEW_VERSION}"
fi

0 comments on commit e44c20a

Please sign in to comment.