summaryrefslogtreecommitdiffstats
path: root/vendor/maxmind/web-service-common/dev-bin
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
commit19985dbb8c0aa66dc4bf7905abc1148de909097d (patch)
tree2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /vendor/maxmind/web-service-common/dev-bin
download1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip
Diffstat (limited to '')
-rw-r--r--vendor/maxmind/web-service-common/dev-bin/release.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/vendor/maxmind/web-service-common/dev-bin/release.sh b/vendor/maxmind/web-service-common/dev-bin/release.sh
new file mode 100644
index 0000000..a5de030
--- /dev/null
+++ b/vendor/maxmind/web-service-common/dev-bin/release.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -eu -o pipefail
+
+
+changelog=$(cat CHANGELOG.md)
+
+regex='
+([0-9]+\.[0-9]+\.[0-9]+) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
+-*
+
+((.|
+)*)
+'
+
+if [[ ! $changelog =~ $regex ]]; then
+ echo "Could not find date line in change log!"
+ exit 1
+fi
+
+version="${BASH_REMATCH[1]}"
+date="${BASH_REMATCH[2]}"
+notes="$(echo "${BASH_REMATCH[3]}" | sed -n -E '/^[0-9]+\.[0-9]+\.[0-9]+/,$!p')"
+
+if [[ "$date" != $(date +"%Y-%m-%d") ]]; then
+ echo "$date is not today!"
+ exit 1
+fi
+
+tag="v$version"
+
+if [ -n "$(git status --porcelain)" ]; then
+ echo ". is not clean." >&2
+ exit 1
+fi
+
+php composer.phar self-update
+php composer.phar update
+
+./vendor/bin/phpunit
+
+echo "Release notes for $tag:"
+echo "$notes"
+
+read -e -p "Commit changes and push to origin? " should_push
+
+if [ "$should_push" != "y" ]; then
+ echo "Aborting"
+ exit 1
+fi
+
+git push
+
+message="$version
+
+$notes"
+
+hub release create -m "$message" "$tag"
+
+git push --tags