xref: /aosp_15_r20/external/cronet/third_party/protobuf/php/release.sh (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#!/bin/bash
2
3set -ex
4
5# Make sure we are in a protobuf source tree.
6[ -f "php/release.sh" ] || {
7  echo "This script must be ran under root of protobuf source tree."
8  exit 1
9}
10
11VERSION=$1
12
13rm -rf protobuf-php
14git clone https://github.com/protocolbuffers/protobuf-php.git
15
16# Clean old files
17rm -rf protobuf-php/src
18
19# Copy files
20cp -r php/src protobuf-php
21cp php/composer.json.dist protobuf-php/composer.json
22
23cd protobuf-php
24git add .
25git commit -m "$VERSION"
26if [ $(git tag -l "$VERSION") ]; then
27  echo "tag $VERSION already exists"
28else
29  git tag "$VERSION"
30fi
31