Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
758 B
41 lines
758 B
#!/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 |
|
|
|
git clone https://github.com/protocolbuffers/protobuf-php.git |
|
git clone https://github.com/protocolbuffers/protobuf.git |
|
|
|
# Clean old files |
|
pushd protobuf-php |
|
rm -rf src |
|
popd |
|
|
|
# Checkout the target version |
|
pushd protobuf/php |
|
git checkout -b $VERSION |
|
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" |
|
if [ $(git tag -l "$VERSION") ]; then |
|
echo "tag $VERSION already exists" |
|
else |
|
git tag "$VERSION" |
|
fi |
|
popd |
|
|
|
# Clean up |
|
rm -rf protobuf
|
|
|