You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .PHONY: test
  2. test:
  3. unset KOSMORRO_LATITUDE; \
  4. unset KOSMORRO_LONGITUDE; \
  5. unset KOSMORRO_TIMEZONE; \
  6. LANG=C pipenv run python3 -m coverage run -m unittest test
  7. build: i18n manpages
  8. python3 setup.py sdist bdist_wheel
  9. messages:
  10. pipenv run python setup.py extract_messages --output-file=kosmorrolib/locales/messages.pot
  11. manpages:
  12. ronn --roff manpage/kosmorro.1.md
  13. ronn --roff manpage/kosmorro.7.md
  14. i18n:
  15. if [ "$$POEDITOR_API_ACCESS" != "" ]; then \
  16. python3 .scripts/build/getlangs.py; \
  17. python3 setup.py compile_catalog; \
  18. fi
  19. env:
  20. @if [[ "$$RELEASE_NUMBER" == "" ]]; \
  21. then echo "Missing environment variable: RELEASE_NUMBER."; \
  22. echo 'Example: export RELEASE_NUMBER="1.0.0" (without the leading "v")'; \
  23. exit 1; \
  24. fi
  25. release: env
  26. @echo -e "\e[1mCreating release with version number \e[36m$$RELEASE_NUMBER\e[0m"
  27. @echo
  28. sed "s/^VERSION =.*/VERSION = '$$RELEASE_NUMBER'/g" kosmorrolib/version.py > version.py
  29. mv version.py kosmorrolib/version.py
  30. pipenv run python setup.py extract_messages --output-file=kosmorrolib/locales/messages.pot > /dev/null
  31. conventional-changelog -p angular -i CHANGELOG.md -s
  32. sed "0,/\\[\\]/s/\\[\\]/[v$$RELEASE_NUMBER]/g" CHANGELOG.md > /tmp/CHANGELOG.md
  33. sed -e "s/...v)/...v$$RELEASE_NUMBER)/" /tmp/CHANGELOG.md > CHANGELOG.md
  34. rm /tmp/CHANGELOG.md
  35. @echo
  36. @echo -e "\e[1mRelease \e[36m$$RELEASE_NUMBER\e[39m is ready to commit."
  37. @echo -e "Please review the changes, then invoke \e[33mmake finish-release\e[39m."
  38. finish-release: env
  39. git add CHANGELOG.md kosmorrolib/version.py kosmorrolib/locales/messages.pot
  40. git commit -m "build: bump version $$RELEASE_NUMBER"
  41. git tag "v$$RELEASE_NUMBER"
  42. git checkout features
  43. git merge master
  44. git checkout master
  45. @echo
  46. @echo -e "\e[1mVersion \e[36m$$RELEASE_NUMBER\e[39m successfully tagged!"
  47. @echo -e "Invoke \e[33mgit push origin master features v$$RELEASE_NUMBER\e[39m to finish."