2019-02-26 17:25:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
# Make sure we are in a protobuf source tree.
|
|
|
|
[ -f "php/release.sh" ] || {
|
|
|
|
echo "This script must be ran under root of protobuf source tree."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
VERSION=$1
|
|
|
|
|
2020-10-08 21:56:27 +00:00
|
|
|
git clone https://github.com/protocolbuffers/protobuf-php.git
|
|
|
|
git clone https://github.com/protocolbuffers/protobuf.git
|
2019-02-26 17:25:37 +00:00
|
|
|
|
|
|
|
# Clean old files
|
|
|
|
pushd protobuf-php
|
|
|
|
rm -rf src
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Checkout the target version
|
|
|
|
pushd protobuf/php
|
2019-05-06 19:58:01 +00:00
|
|
|
git checkout -b $VERSION
|
2019-02-26 17:25:37 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
# Copy files
|
|
|
|
pushd protobuf-php
|
|
|
|
mv ../protobuf/php/src src
|
|
|
|
mv ../protobuf/composer.json composer.json
|
|
|
|
sed -i 's|php/src|src|g' composer.json
|
|
|
|
git add .
|
|
|
|
git commit -m "$VERSION"
|
|
|
|
git tag "$VERSION"
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
rm -rf protobuf
|