From 295df1922e6d026ed8cbc8dd83bd3891d521fa91 Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Sat, 21 Mar 2020 19:24:40 -0500 Subject: [PATCH] Update release process --- docs/development-guide.md | 15 +-------------- scripts/release.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 scripts/release.sh diff --git a/docs/development-guide.md b/docs/development-guide.md index 854e37ec..35d0dee1 100644 --- a/docs/development-guide.md +++ b/docs/development-guide.md @@ -26,20 +26,7 @@ Also, add any necessary tests for new code. ### Deployment -- Bump version in `shallow-backup/constants.py` - -```bash -# From project root directory -$ export SB_VERSION="v$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")" -$ export SB_VERSION_NO_V="$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")" -$ git checkout master && git pull -$ git tag -a "$SB_VERSION" -m "shallow-backup $SB_VERSION" && git push -$ github_changelog_generator --user alichtman --project shallow-backup -$ ga . && gc -m "Add CHANGELOG for $SB_VERSION" && git push -$ rm -rf dist/* && python3 setup.py sdist -$ hub release create $SB_VERSION --file dist/shallow-backup-$SB_VERSION_NO_V.tar.gz -m "shallow-backup $SB_VERSION" -$ pypiup -``` +Run `scripts/release.sh` from the project root. ### Code Style diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 00000000..3c180bf0 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Release script for shallow-backup + +# Must be run from project root directory +SB_VERSION="v$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")" +SB_VERSION_NO_V="$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")" + +read -r -p "Release shallow-backup $SB_VERSION? [y/N] " response +case "$response" in + [yY][eE][sS]|[yY]) + echo "Releasing." + ;; + *) + echo "Aborting." + exit; + ;; +esac + +git checkout master && git pull +git tag -a "$SB_VERSION" -m "shallow-backup $SB_VERSION" && git push +github_changelog_generator --user alichtman --project shallow-backup +ga . && gc -m "Add CHANGELOG for $SB_VERSION" && git push +rm -rf dist/* && python3 setup.py sdist +hub release create $SB_VERSION --file dist/shallow-backup-$SB_VERSION_NO_V.tar.gz -m "shallow-backup $SB_VERSION" +pypiup