automating releases
This commit is contained in:
parent
ddd09621e8
commit
9a6bee3a83
25
.release
Executable file
25
.release
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_version=$(cat ./steadymark/version.py | egrep version | sed "s,^version = '\([^']*\)',\1,g")
|
||||
printf "The current version is \033[1;33m$current_version\033[0m, type the new version:\n"
|
||||
read newversion
|
||||
|
||||
|
||||
find_files () {
|
||||
find . -name '*.py' -or -name '*.yml' -or -name '*.md'
|
||||
}
|
||||
|
||||
update_files (){
|
||||
find_files | xargs gsed -i "s,$current_version,$newversion,g"
|
||||
}
|
||||
|
||||
printf "\033[A\033[A\rI will make a new commit named \033[1;33m'New release $newversion'\033[0m\n"
|
||||
printf "Are you sure? [\033[1;32myes\033[0m or \033[1;31mno\033[0m]\n"
|
||||
read sure
|
||||
|
||||
if [ $sure == "yes" ]; then
|
||||
update_files
|
||||
printf "New release: \033[1;32m$newversion\033[0m\n"
|
||||
git add `find_files`
|
||||
git commit -am "New release: $newversion"
|
||||
fi;
|
7
Makefile
7
Makefile
@ -21,10 +21,9 @@ clean:
|
||||
@for pattern in `cat .gitignore`; do rm -rf $$pattern; find . -name "$$pattern" -exec rm -rf {} \;; done
|
||||
@echo "OK!"
|
||||
|
||||
release: test publish
|
||||
release: test
|
||||
@./.release
|
||||
@python setup.py sdist register upload
|
||||
@printf "Exporting to $(filename)... "
|
||||
@tar czf $(filename) steadymark setup.py README.md COPYING
|
||||
@echo "DONE!"
|
||||
|
||||
publish:
|
||||
@python setup.py sdist register upload
|
||||
|
Loading…
Reference in New Issue
Block a user