-
Notifications
You must be signed in to change notification settings - Fork 11.1k
/
Copy pathrelease.sh
executable file
·76 lines (57 loc) · 1.72 KB
/
release.sh
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
set -e
# Make sure the release tag is provided.
if (( "$#" != 1 ))
then
echo "Tag has to be provided."
exit 1
fi
RELEASE_BRANCH="8.x"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
VERSION=$1
# Make sure current branch and release branch match.
if [[ "$RELEASE_BRANCH" != "$CURRENT_BRANCH" ]]
then
echo "Release branch ($RELEASE_BRANCH) does not match the current active branch ($CURRENT_BRANCH)."
exit 1
fi
# Make sure the working directory is clear.
if [[ ! -z "$(git status --porcelain)" ]]
then
echo "Your working directory is dirty. Did you forget to commit your changes?"
exit 1
fi
# Make sure latest changes are fetched first.
git fetch origin
# Make sure that release branch is in sync with origin.
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/$RELEASE_BRANCH) ]]
then
echo "Your branch is out of date with its upstream. Did you forget to pull or push any changes before releasing?"
exit 1
fi
# Always prepend with "v"
if [[ $VERSION != v* ]]
then
VERSION="v$VERSION"
fi
# Tag Framework
git tag $VERSION
git push origin --tags
# Tag Components
for REMOTE in auth broadcasting bus cache collections config console container contracts cookie database encryption events filesystem hashing http log macroable mail notifications pagination pipeline queue redis routing session support testing translation validation view
do
echo ""
echo ""
echo "Releasing $REMOTE";
TMP_DIR="/tmp/laravel-split"
REMOTE_URL="git@github.com:illuminate/$REMOTE.git"
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL .
git checkout "$RELEASE_BRANCH";
git tag $VERSION
git push origin --tags
)
done