-
-
Notifications
You must be signed in to change notification settings - Fork 338
/
release
executable file
·56 lines (44 loc) · 1.54 KB
/
release
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# TODO: prepare changelog
set -e
if (( "$#" != 1 ))
then
echo "Tag has to be provided"
exit 1
fi
./bin/subtree-split
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
for REMOTE in origin core paypal-express-checkout paypal-pro-checkout paypal-pro-hosted authorize-net-aim be2bill paypal-masspay \
paypal-ipn paypal-rest offline payex klarna-checkout klarna-invoice stripe sofort skeleton
do
echo ""
echo ""
echo "Releasing $REMOTE";
TMP_DIR="/tmp/payum-repo"
REMOTE_URL=`git remote get-url $REMOTE`
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL . --depth=200
git checkout $CURRENT_BRANCH;
# gsort comes with coreutils packages. brew install coreutils
LAST_RELEASE=$(git tag -l [0-9].* | gsort -V | tail -n1 )
if [[ -z "$LAST_RELEASE" ]]; then
echo "There has not been any releases. Releasing $1";
git tag $1 -s -m "Release $1"
git push origin --tags
else
echo "Last release $LAST_RELEASE";
CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" ]]; then
echo "There are changes since last release. Releasing $1";
git tag $1 -s -m "Release $1"
git push origin --tags
else
echo "No change since last release.";
fi
fi
)
done