File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ # get new version from __init__.py
6+ new_version=$( grep --color=never -oP ' __version__\s*=\s*"\K[0-9]+\.[0-9]+\.[0-9]+' " src/deglib/__init__.py" )
7+ echo " detected new version: $new_version "
8+
9+ # get old version from pypi
10+ old_version=$( curl -s " https://pypi.org/pypi/deglib/json" | jq -r ' .info.version' )
11+
12+ # compare versions
13+ if [ " $old_version " = " $new_version " ]; then
14+ echo " ERROR: current version equals version on pypi"
15+ read -p " have you changed the version in \" src/deglib/__init__.py\" ? y/[n]: " answer
16+ if [ " $answer " != " y" ]; then
17+ exit 0
18+ fi
19+ fi
20+
21+ # publish
22+ git add -A && git commit -m " v$new_version " && git tag -a " v$new_version " -m " v$new_version "
23+ git push && git push origin --tags
You can’t perform that action at this time.
0 commit comments