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.
 
 
 
 
 
 

30 lines
788 B

  1. #!/usr/bin/env bash
  2. function check_env_variables_are_setted {
  3. if [ -z "${NPM_TOKEN}" ]; then
  4. echo "Need to set NPM_TOKEN env variable to release node modules"
  5. exit 1
  6. fi
  7. }
  8. set +o errexit
  9. check_env_variables_are_setted
  10. set -o errexit
  11. set -o pipefail
  12. set -o nounset
  13. function push_packages_on_npm {
  14. touch ~/.npmrc
  15. grep --fixed-strings --line-regexp --silent "//registry.npmjs.org/:_authToken=$NPM_TOKEN" ~/.npmrc || echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
  16. projects="lesspass lesspass-crypto lesspass-entropy lesspass-fingerprint lesspass-pure lesspass-render-password"
  17. for project in ${projects}
  18. do
  19. pushd packages/${project}
  20. yarn publish --non-interactive
  21. popd
  22. done
  23. }
  24. push_packages_on_npm