release.sh 673 B

12345678910111213141516171819202122232425262728293031323334353637
  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. git clone https://github.com/protocolbuffers/protobuf-php.git
  10. git clone https://github.com/protocolbuffers/protobuf.git
  11. # Clean old files
  12. pushd protobuf-php
  13. rm -rf src
  14. popd
  15. # Checkout the target version
  16. pushd protobuf/php
  17. git checkout -b $VERSION
  18. popd
  19. # Copy files
  20. pushd protobuf-php
  21. mv ../protobuf/php/src src
  22. mv ../protobuf/composer.json composer.json
  23. sed -i 's|php/src|src|g' composer.json
  24. git add .
  25. git commit -m "$VERSION"
  26. git tag "$VERSION"
  27. popd
  28. # Clean up
  29. rm -rf protobuf