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

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