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.
 
 
 
 
 
 

53 line
1.2 KiB

  1. #!/usr/bin/env bash
  2. set +o errexit
  3. function check_branch_is_master {
  4. BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2)
  5. if [ $BRANCH_NAME != "master" ]
  6. then
  7. echo >&2 "Current branch is not master. Aborting."
  8. exit 1
  9. fi
  10. }
  11. function check_tag_is_present {
  12. git describe --exact-match --tags
  13. if [ $? != 0 ]
  14. then
  15. echo >&2 "Current revision is not tagged. Aborting."
  16. exit 1
  17. fi
  18. }
  19. function check_repository_is_clean {
  20. git diff-index --quiet HEAD
  21. if [ $? == 1 ]
  22. then
  23. echo >&2 "Git repository not clean. Aborting."
  24. exit 1
  25. fi
  26. }
  27. function check_lesspass_pure_built_files_are_updated {
  28. yarn workspace lesspass-pure run build
  29. check_repository_is_clean
  30. }
  31. function check_lesspass_pure_built_files_are_updated {
  32. yarn workspace lesspass-web-extension run build
  33. check_repository_is_clean
  34. }
  35. check_branch_is_master
  36. check_tag_is_present
  37. check_lesspass_web_extension_built_files_are_updated
  38. check_lesspass_pure_built_files_are_updated
  39. set -o errexit
  40. set -o pipefail
  41. set -o nounset
  42. yarn workspace lesspass-web-extension run release
  43. VERSION=$(grep -Po '(?<="version": ")[^"]*' package.json)
  44. echo "See the new release on https://github.com/lesspass/lesspass/releases/tag/${VERSION}"