Skip to content

Commit

Permalink
Update release process
Browse files Browse the repository at this point in the history
  • Loading branch information
alichtman committed Mar 22, 2020
1 parent f1a53e5 commit 295df19
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
15 changes: 1 addition & 14 deletions docs/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
25 changes: 25 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 295df19

Please sign in to comment.