release.sh 565 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -ex
  3. # Make sure we are in a protobuf source tree.
  4. [ -f "php/release.sh" ] || {
  5. echo "This script must be ran under root of protobuf source tree."
  6. exit 1
  7. }
  8. VERSION=$1
  9. rm -rf protobuf-php
  10. git clone https://github.com/protocolbuffers/protobuf-php.git
  11. # Clean old files
  12. rm -rf protobuf-php/src
  13. # Copy files
  14. cp -r php/src protobuf-php
  15. cp php/composer.json.dist protobuf-php/composer.json
  16. cd protobuf-php
  17. git add .
  18. git commit -m "$VERSION"
  19. if [ $(git tag -l "$VERSION") ]; then
  20. echo "tag $VERSION already exists"
  21. else
  22. git tag "$VERSION"
  23. fi