Fixed PHP release script.

Previously it was releasing content from main/master, not the
release branch!

I fixed this by not checking out a separate copy of protobuf.
Also updated the composer.json so we don't need to rewrite it with
sed.
pull/9832/head
Joshua Haberman 3 years ago
parent 616a7ef54d
commit 634a5681b8
  1. 4
      php/composer.json.dist
  2. 23
      php/release.sh

@ -16,8 +16,8 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Google\\Protobuf\\": "php/src/Google/Protobuf", "Google\\Protobuf\\": "src/Google/Protobuf",
"GPBMetadata\\Google\\Protobuf\\": "php/src/GPBMetadata/Google/Protobuf" "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf"
} }
} }
} }

@ -10,24 +10,17 @@ set -ex
VERSION=$1 VERSION=$1
rm -rf protobuf-php
git clone https://github.com/protocolbuffers/protobuf-php.git git clone https://github.com/protocolbuffers/protobuf-php.git
git clone https://github.com/protocolbuffers/protobuf.git
# Clean old files # Clean old files
pushd protobuf-php rm -rf protobuf-php/src
rm -rf src
popd
# Checkout the target version
pushd protobuf/php
git checkout -b $VERSION
popd
# Copy files # Copy files
pushd protobuf-php cp -r php/src protobuf-php
mv ../protobuf/php/src src cp php/composer.json.dist protobuf-php/composer.json
mv ../protobuf/php/composer.json.dist composer.json
sed -i 's|php/src|src|g' composer.json cd protobuf-php
git add . git add .
git commit -m "$VERSION" git commit -m "$VERSION"
if [ $(git tag -l "$VERSION") ]; then if [ $(git tag -l "$VERSION") ]; then
@ -35,7 +28,3 @@ if [ $(git tag -l "$VERSION") ]; then
else else
git tag "$VERSION" git tag "$VERSION"
fi fi
popd
# Clean up
rm -rf protobuf

Loading…
Cancel
Save