publish.sh 391 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. # get current version
  3. VERSION=$(npm ls --json=true mgrs | grep version | awk '{ print $2}'| sed -e 's/^"//' -e 's/"$//')
  4. # Build
  5. git checkout -b build
  6. npm run build
  7. git add dist -f
  8. git commit -m "build $VERSION"
  9. # Tag and push
  10. git tag $VERSION
  11. git push --tags git@github.com:proj4js/mgrs.git $VERSION
  12. # Publish
  13. npm publish
  14. # Cleanup
  15. git checkout master
  16. git branch -D build