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
|
|
|
|
|
2022-04-21 23:38:04 +00:00
|
|
|
rm -rf protobuf-php
|
2020-10-08 21:56:27 +00:00
|
|
|
git clone https://github.com/protocolbuffers/protobuf-php.git
|
2019-02-26 17:25:37 +00:00
|
|
|
|
|
|
|
# Clean old files
|
2022-04-21 23:38:04 +00:00
|
|
|
rm -rf protobuf-php/src
|
2019-02-26 17:25:37 +00:00
|
|
|
|
|
|
|
# Copy files
|
2022-04-21 23:38:04 +00:00
|
|
|
cp -r php/src protobuf-php
|
|
|
|
cp php/composer.json.dist protobuf-php/composer.json
|
|
|
|
|
|
|
|
cd protobuf-php
|
2019-02-26 17:25:37 +00:00
|
|
|
git add .
|
|
|
|
git commit -m "$VERSION"
|
2022-03-18 15:54:55 +00:00
|
|
|
if [ $(git tag -l "$VERSION") ]; then
|
|
|
|
echo "tag $VERSION already exists"
|
|
|
|
else
|
|
|
|
git tag "$VERSION"
|
|
|
|
fi
|