Skip to content

Commit

Permalink
Merge pull request #9832 from haberman/php-dist
Browse files Browse the repository at this point in the history
Fixed PHP release script.
  • Loading branch information
haberman authored Apr 22, 2022
2 parents 616a7ef + 634a568 commit 21027a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
4 changes: 2 additions & 2 deletions php/composer.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
23 changes: 6 additions & 17 deletions php/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,21 @@ 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
echo "tag $VERSION already exists"
else
git tag "$VERSION"
fi
popd

# Clean up
rm -rf protobuf

0 comments on commit 21027a2

Please sign in to comment.