haruhi-dl/devscripts/release.sh

25 lines
726 B
Bash
Raw Normal View History

2013-01-06 22:50:20 +01:00
#!/bin/bash
2021-06-24 13:07:07 +02:00
if [[ "$(basename $(pwd))" == 'devscripts' ]]; then
cd ..
fi
2021-06-24 13:07:07 +02:00
v="$(date "+%Y.%m.%d")"
2021-06-24 13:07:07 +02:00
if [[ "$(grep "'$v" haruhi_dl/version.py)" != '' ]]; then #' is this the first release of the day?
if [[ "$(grep -Poh '[0-9]{4}\.[0-9]{2}\.[0-9]{2}\.[0-9]' haruhi_dl/version.py)" != '' ]]; then # so, 2nd or nth?
v="$v.$(($(cat haruhi_dl/version.py | grep -Poh '[0-9]{4}\.[0-9]{2}\.[0-9]{2}\.[0-9]' | grep -Poh '[0-9]+$')+1))"
else
v="$v.1"
fi
fi
2021-06-24 13:07:07 +02:00
sed "s/__version__ = '.*'/__version__ = '$v'/g" -i haruhi_dl/version.py
2013-02-01 18:01:53 +01:00
2021-06-24 13:07:07 +02:00
python3 setup.py build_lazy_extractors
2021-06-24 13:18:36 +02:00
python3 devscripts/prerelease_codegen.py
2021-06-24 13:07:07 +02:00
rm -R build dist
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
devscripts/wine-py2exe.sh setup.py