Skip to content

Commit 9f2b91d

Browse files
authored
Merge pull request #98 from php-enqueue/release-if-there-are-changes
Do pkg release if there are changes in it.
2 parents 7de79c9 + 3c7960b commit 9f2b91d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

bin/release

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
set -x
54

65
if (( "$#" != 1 ))
76
then
@@ -17,6 +16,10 @@ CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
1716

1817
for REMOTE in origin psr-queue stomp amqp-ext sqs fs redis dbal null enqueue simple-client enqueue-bundle job-queue test
1918
do
19+
echo ""
20+
echo ""
21+
echo "Releasing $REMOTE";
22+
2023
TMP_DIR="/tmp/enqueue-repo"
2124
REMOTE_URL=`git remote get-url $REMOTE`
2225

@@ -25,9 +28,20 @@ do
2528

2629
(
2730
cd $TMP_DIR;
28-
git clone $REMOTE_URL . --depth=10
31+
git clone $REMOTE_URL . --depth=200
2932
git checkout $CURRENT_BRANCH;
30-
git tag $1 -s -m "Release $1"
31-
git push origin --tags
33+
LAST_RELEASE=$(git tag -l [0-9].* | tail -n1)
34+
35+
echo "Last release $LAST_RELEASE";
36+
37+
CHANGES_SINCE_LAST_RELEASE=$(git log $LAST_RELEASE...master | xargs echo -n)
38+
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" ]]; then
39+
echo "There are changes since last release. Releasing $1";
40+
41+
git tag $1 -s -m "Release $1"
42+
git push origin --tags
43+
else
44+
echo "No change since last release.";
45+
fi
3246
)
3347
done

0 commit comments

Comments
 (0)