-
Notifications
You must be signed in to change notification settings - Fork 13
/
release.sh
49 lines (40 loc) · 1.38 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
#!/bin/bash
# release alembic
if [[ $# -lt 3 ]]; then
echo "usage: $(basename $0) previous-version new-version next-version" >&2
exit 1
fi
previous_version=$1
version=$2
next_version=$3
echo ""
echo "Start release of $version, previous version is $previous_version"
echo ""
echo ""
lein do clean, with-profile +no-checkouts test && \
git flow release start $version || exit 1
lein with-profile +release set-version ${version} :previous-version ${previous_version} \
|| { echo "set version failed" >2 ; exit 1; }
echo ""
echo ""
echo "Changes since $previous_version"
git --no-pager log --pretty=changelog $previous_version..
echo ""
echo ""
echo "Now edit project.clj, ReleaseNotes and README"
$EDITOR project.clj
$EDITOR ReleaseNotes.md
$EDITOR README.md
echo -n "commiting project.clj, release notes and readme. enter to continue:" \
&& read x \
&& git add project.clj ReleaseNotes.md README.md \
&& git commit -m "Updated project.clj, release notes and readme for $version" \
&& echo -n "Peform release. enter to continue:" && read x \
&& lein do clean, with-profile +no-checkouts test, deploy clojars \
&& rm -f pom.xml \
&& git flow release finish $version \
&& echo "Now push to github. Don't forget the tags!" \
&& lein with-profile +doc doc \
&& lein with-profile +release set-version ${next_version} \
&& git add project.clj \
&& git commit -m "Updated version for next release cycle"