From 634a5681b8f249d4cce876e36d179d9c8a8e12d2 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 21 Apr 2022 23:38:04 +0000 Subject: [PATCH] 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. --- php/composer.json.dist | 4 ++-- php/release.sh | 23 ++++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/php/composer.json.dist b/php/composer.json.dist index 825f29da3b40..70af0a03303d 100644 --- a/php/composer.json.dist +++ b/php/composer.json.dist @@ -16,8 +16,8 @@ }, "autoload": { "psr-4": { - "Google\\Protobuf\\": "php/src/Google/Protobuf", - "GPBMetadata\\Google\\Protobuf\\": "php/src/GPBMetadata/Google/Protobuf" + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" } } } diff --git a/php/release.sh b/php/release.sh index 4ababf1b2550..f75906a04cb1 100755 --- a/php/release.sh +++ b/php/release.sh @@ -10,24 +10,17 @@ set -ex VERSION=$1 +rm -rf protobuf-php 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 +rm -rf protobuf-php/src # Copy files -pushd protobuf-php -mv ../protobuf/php/src src -mv ../protobuf/php/composer.json.dist composer.json -sed -i 's|php/src|src|g' composer.json +cp -r php/src protobuf-php +cp php/composer.json.dist protobuf-php/composer.json + +cd protobuf-php git add . git commit -m "$VERSION" if [ $(git tag -l "$VERSION") ]; then @@ -35,7 +28,3 @@ if [ $(git tag -l "$VERSION") ]; then else git tag "$VERSION" fi -popd - -# Clean up -rm -rf protobuf