From 7102346f87ab1415726f49c7bf619d949a8607d9 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Tue, 27 Sep 2022 09:43:38 +0200 Subject: [PATCH] Update release.sh (#2421) in order to reflect the current release process --- release.sh | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/release.sh b/release.sh index d61ae054..18ce75cc 100755 --- a/release.sh +++ b/release.sh @@ -1,31 +1,28 @@ -#!/bin/sh +#!/bin/bash -if [ $# -ne 1 ]; then - >&2 echo "usage: $0 " - exit 1 -fi - -readonly VERSIONFILE="patroni/version.py" +# Release process: +# 1. Open a PR that updates release notes and Patroni version +# 2. Merge it +# 3. Run release.sh ## Bail out on any non-zero exitcode from the called processes set -xe -python3 --version +if python3 --version &> /dev/null; then + alias python=python3 + shopt -s expand_aliases +fi + +python --version git --version -version=$1 +version=$(python -c 'from patroni.version import __version__; print(__version__)') -sed -i "s/__version__ = .*/__version__ = '${version}'/" "${VERSIONFILE}" -python3 setup.py clean -python3 setup.py test -python3 setup.py flake8 +python setup.py clean +python setup.py test +python setup.py flake8 -git add "${VERSIONFILE}" +python setup.py sdist bdist_wheel upload -git commit -m "Bumped version to $version" -git push - -python3 setup.py sdist bdist_wheel upload - -git tag v${version} +git tag "v$version" git push --tags