aboutsummaryrefslogtreecommitdiff
path: root/php/release.sh
blob: 6b0baac78ff578e08adfb2d6443821e65e52b2a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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"
git tag "$VERSION"
popd

# Clean up
rm -rf protobuf