release.sh 728 B

1234567891011121314151617
  1. #!/bin/bash
  2. # actions requires a node_modules dir https://github.com/actions/toolkit/blob/master/docs/javascript-action.md#publish-a-releasesv1-action
  3. # but its recommended not to check these in https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#recommendations
  4. # as such the following hack is how we dill with it
  5. if [[ $# -ne 1 ]]; then
  6. echo "please pass a release version. i.e. $0 v1"
  7. exit 1
  8. fi
  9. git checkout -b releases/$1 # If this branch already exists, omit the -b flag
  10. rm -rf node_modules
  11. sed -i '/node_modules/d' .gitignore # Bash command that removes node_modules from .gitignore
  12. npm install --production
  13. git add node_modules -f .gitignore
  14. git commit -m node_modules
  15. git push origin releases/$1