File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Command to upload new version release at pypi
4+ # ./upload.sh pypi
5+ if [ " $1 " == " pypi" ]; then
6+ python setup.py sdist upload -r pypi
7+ fi
8+
9+ if [ " $1 " == " git" ]; then
10+
11+ # Command to upload new tag version
12+ # by checking the last version release.
13+ # ./upload.sh git tag
14+ if [ " $2 " == " tag" ]; then
15+ # check last release version and plus it with 1
16+ # eg: 1.0.8 => 1.0.9
17+ new_version=$(
18+ git tag | tail -n1 | awk -F ' [/.]' ' { gsub("v", "", $1); print $1$2$3 + 1}' | fold -w1 | paste -sd.
19+ ) ;
20+ # echo "git tag -a v$new_version -m 'Release v$new_version'";
21+ git tag -a " v$new_version " -m " Release v$new_version " ;
22+ git push origin " v$new_version " ;
23+ echo " Current version: v$new_version " ;
24+ fi
25+
26+ # Command to push new git commit
27+ # ./upload.sh git commit
28+ if [ " $2 " == " commit" ]; then
29+ echo -n " Commit name > " ;
30+ read commit_name
31+
32+ if [ " $commit_name " ]; then
33+ git add . ;
34+ git commit -m " $commit_name " ;
35+ git push -u origin master;
36+ fi
37+ fi
38+ fi
You can’t perform that action at this time.
0 commit comments